Open ceztko opened 7 years ago
For the second question, I can answer my self. According to the scope documentaton, the solution scope can be obtained importing an IProjectService
reference (and not IProjectServices
<- note the final "s").
So the constructor becomes:
[ImportingConstructor]
protected SolutionConfigurationPropertiesProvider(IProjectService service)
: base(service.Services)
{
and the provider is per solution global.
The first question is still open: so far I couldn't invalidate a VCProject by modifying its global properties with IProjectGlobalPropertiesProvider
. When doing so, VS still think the project is up-to-date.
Hey @ceztko, sorry to post an unrelated question here, but, did you find a way to instantiate a VCProjectEngine
, or ultimately a VCProject
?
I'm looking to write some tooling for VCXPROJ files, but can't find any documentation to get started.
@JunielKatarn I'm really not so thankful to you for giving me the illusion that someone answered this long time unanswered question :) I never played with VCProject to that extent but it seems this[1] is a good start. I can't help you further.
Hi @ceztko - I believe you're hitting a problem with the VC project cache. Open "Tools->Options->Projects and Solutions->VC++ Project Settings" and then set "Enable Project Caching" to "false" then try the scenario again. You will need to restart VS.
That's not a reasonable workaround - but may unblock you. If this scenario is important, consider reporting a bug against the VC team: https://developercommunity.visualstudio.com/content/problem/post.html?space=62
I'm developer of a extension for VS to add $(SolutionConfiguration) and $(SolutionPlatform) macros (the values that can be seen on the IDE combobox) to VS project settings. Since altering ProjectCollection is becoming less and less predictable, I am trying to follow the documentation to define a
IProjectGlobalPropertiesProvider
MEF component that will plug this macros without accessing directly the MSBuild project or collection. This is my code:1) This is code is not working: the macros are correctly passed to the project settings GUI (I can see them in the macros editor) but are ignored during build. If I invalidate project settings with dummy modification, reverted immediately after, the build system is able to recognize the change in the properties and builds correctly. The versioning system that is in place seems to be correct to me, I also got inspiration from here; 2) EDIT: Answered How do I ensure the provider will be a singleton for all VCProject(s)? The imported constructor is called multiple times.
Note: the capability I'm using, "VisualC + VCProjectEngineFactory", is taken from inspected VS code and seems to apply correctly to VCProject(s). Same problems happen if using the (supposedly) global capability "".