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

Invalid code generated by MSBuilder.ThisAssembly.Vsix #18

Open
mhutch opened this issue Jan 11, 2018 · 5 comments
Open

Invalid code generated by MSBuilder.ThisAssembly.Vsix #18

mhutch opened this issue Jan 11, 2018 · 5 comments

Comments

@mhutch
Copy link

mhutch commented Jan 11, 2018

I added MSBuilder.ThisAssembly.Vsix 0.1.8 to a VSIX project, and the generated ThisAssembly.Vsix.g.cs started with invalid C#:

#define GLOBALNAMESPACE
#define 
#pragma warning disable 0436
@mhutch
Copy link
Author

mhutch commented Jan 11, 2018

I added a GitInfo reference - looks like a missing dependency - but it didn't regen the file, even when i cleaned. I had to manually delete the file to get it to regen.

@mhutch
Copy link
Author

mhutch commented Jan 11, 2018

And then the ThisAssembly class ends up conflicting with an internal ThisAssembly class in Microsoft.VisualStudio.Composition

@mhutch
Copy link
Author

mhutch commented Jan 11, 2018

Would it maybe be better to default ThisAssemblyNamespace to RootNamespace?

@mhutch
Copy link
Author

mhutch commented Jan 11, 2018

looks like the last issue was some kind of roslyn typesystem caching. global worked fine after dirtying the project.

@kzu
Copy link
Contributor

kzu commented Apr 24, 2018

Heya @mhutch, sorry I missed this. The "conflict" with other internal ThisAssembly classes is kinda expected. Many assemblies use this type name for sharing this kind of data.

Also, not defaulting the namespace to RootNamespace is also sort of by design, since that's also the way most other libraries do it (using no namespace at all).

Finally, I'm not using this much lately, and just relying on MSBuild props injected into the VSIX manifest instead using the token replacement syntax (like |MyProject.Vsix;GetVsixVersion|) instead. Potentially combined with the https://github.com/MobileEssentials/MSBuilder/tree/master/src/ThisAssembly.Metadata

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

No branches or pull requests

2 participants