Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Visual Studio 2015 #154

Merged
merged 10 commits into from
Aug 7, 2019
Merged

Add support for Visual Studio 2015 #154

merged 10 commits into from
Aug 7, 2019

Conversation

SSE4
Copy link

@SSE4 SSE4 commented Jul 30, 2019

closes #98
closes #66
closes #75

extension doesn't work in Visual Studio 2015 - it's because interface Microsoft.VisualStudio.VCProject has changed between versions 14.0 and 15.0 and it's no longer compatible.
unfortunately, it's impossible to reference both versions of the same interface within single assembly. it's also impossible to solve it somehow in runtime, as at compile time expression like project as VCProject compiles differently depends on VCProject interface version (or more precisely, its guid).
the solution is pretty straightforward:

  1. wrap all code needed from Microsoft.VisualStudio.VCProject and Microsoft.VisualStudio.VCProjectEngine into small wrapper classes. for now, just 3 classes are needed: VCConfiguration, VCProject and VCPropertySheet. (other classes might be easily added on demand using the same approach)
  2. define corresponding interfaces within Core project, so classes are never referenced directly, and we can use late binding for them, so they are loosely coupled.
  3. create two wrapper assemblies for two Visual Studio versions: VCProjectWrapper14 and VCProjectWrapper15. both assemblies use the same sources (3 wrapper classes mentioned above), but reference to different versions of Microsoft.VisualStudio.VCProject
  4. in main assembly, load required wrapper assembly based on the Visual Studio version in use. from the loaded assembly, create an instance of VCProjectWrapper (from the EnvDTE.Project.object) and use it going forward.
  5. ensure we're not referencing Microsoft.VisualStudio.VCProject (and VCProjectEngine) from the main assembly.
  6. downgrade all Visual-Studio related assembly references to the 14.0, so they could be loaded by Visual Studio 2015
  7. use Microsoft.VisualStudio.VCProject (and VCProjectEngine) version 14.0 from NuGet, as we're building on VS2019 image which doesn't have older assemblies installed.

@SSE4 SSE4 requested a review from jgsogo July 30, 2019 15:48
@SSE4 SSE4 added this to the next milestone Jul 30, 2019
@SSE4
Copy link
Author

SSE4 commented Jul 30, 2019

seems like build fails because assemblies like Microsoft.VisualStudio.VCProject, Version=14.0.0.0 aren't found on appveyor... maybe need to try to build on VS2017 appveyor image

@jgsogo
Copy link

jgsogo commented Aug 2, 2019

Look at this wonderful image, Version: 14.0.25431 😍😍😍

image

Please, rebase on top of dev and now the Appveyor wars will start again ^^

Copy link

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all. I like this PR and we are merging it, for sure! 🎉

I would ask you to write a brief description of the solution in the PR for future reference, our future egos would love to read it.

Also, we are naming the classes, projects, ifs,... after the compiler version and I'm not sure if the origin of the problem is related to the compiler version or to the IDE... I don't know if one can install a version of the VS Build Tools and use it with a different version of the IDE, so maybe taking the version from ConanCompilerVersion is not the best we can do.

These are just details, ok? So I want to know just your opinion if it is worth investigating it or not, these are not major issues.

@jgsogo jgsogo modified the milestones: next, 1.2.1 Aug 5, 2019
SSE4 added 7 commits August 5, 2019 01:26
…interfaces

Signed-off-by: SSE4 <tomskside@gmail.com>
Signed-off-by: SSE4 <tomskside@gmail.com>
Signed-off-by: SSE4 <tomskside@gmail.com>
Signed-off-by: SSE4 <tomskside@gmail.com>
Signed-off-by: SSE4 <tomskside@gmail.com>
Signed-off-by: SSE4 <tomskside@gmail.com>
Signed-off-by: SSE4 <tomskside@gmail.com>
SSE4 added 3 commits August 5, 2019 03:10
Signed-off-by: SSE4 <tomskside@gmail.com>
Signed-off-by: SSE4 <tomskside@gmail.com>
Copy link

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready for a release! 🎉

@jgsogo jgsogo merged commit 8aa88c3 into conan-io:dev Aug 7, 2019
@jgsogo jgsogo changed the title fix VS2015 - second attempt Add support for Visual Studio 2015 Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Think alternatives for VS2015 [vs2015] Error loading in VS 2015
2 participants