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

C++ projects are not identified as such when running in VS 2017 RC #156

Closed
VioletGiraffe opened this issue Dec 8, 2016 · 10 comments
Closed
Labels

Comments

@VioletGiraffe
Copy link
Owner

VioletGiraffe commented Dec 8, 2016

The plugin fails in VS 2017 RC because the following line in isVisualCppProject() always returns null:
projectObjectType.GetInterface("Microsoft.VisualStudio.VCProjectEngine.VCProject");

@VioletGiraffe
Copy link
Owner Author

@Dmitry-Me
Copy link
Collaborator

What interfaces are there when you invoke Type.GetInterfaces()?

@VioletGiraffe
Copy link
Owner Author

VioletGiraffe commented Jan 9, 2017

I'll tell you tomorrow (unless I forget) - don't have 2017 on the home PC yet.
I started working on the fix, but it turned out to be very difficult (tedious) to implement because someone (I don't mean you - I don't know who written that piece of code, and I don't want to know) used dynamic and object types a lot for passing the project instance around, and they even mean different types in different parts of the code, and because of that I can't easily refactor it into EnvDTE.Project.

Bottom line: don't do that. Don't ever give up strong typing unless absolutely necessary.

@Dmitry-Me
Copy link
Collaborator

Dmitry-Me commented Jan 9, 2017

Most likely that someone was me. Yes, I agree that having strong typing is good but it all started because different versions of Visual Studio use identical yet formally different sets of interfaces and so having a plugin which supports all of them requires either duck typing or a lot of thunk assemblies and a whole set of Visual Studio SDKs (and Visual Studios too) to build the project.

@VioletGiraffe
Copy link
Owner Author

Hmm. Sorry, I wasn't aware of that problem.

@Dmitry-Me
Copy link
Collaborator

Here it is #12

@VioletGiraffe
Copy link
Owner Author

Right... So I can't just use the Project type?

@Dmitry-Me
Copy link
Collaborator

If it's part of version-specific assembly - no, you cannot make use of it for strong typing. That's why there's dynamic.

@meragrin
Copy link

meragrin commented Jul 13, 2017

@VioletGiraffe
Copy link
Owner Author

Interesting, thanks. Still, I believe that the proposed changes to the code should allow the add-in to circumvent this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants