conan-vs-extension
conan-vs-extension copied to clipboard
conanbuildinfo.props is added multiple times to same configuration
Not sure how I got to this, but the final result is:
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\x64\Release\.conan\conanbuildinfo.props" />
<Import Project="..\x64\Release\.conan\conanbuildinfo.props" />
<Import Project="..\x64\Release\.conan\conanbuildinfo.props" />
</ImportGroup>
Probably it needs to check for existence to not repeat it
very strange, we already have fixed such issue in the past: https://github.com/conan-io/conan-vs-extension/issues/77
This was an issue before, but now (v1.1.x
) we are checking for a property file with the same path before adding it to the project. Can you re-check the version you are using?
One more thing to try, just in case: what happens if I run Conan several times without waiting for a previous run to finish?
I experience the same problem (for your information, I'm using v1.2.2.346 from Visual Studio marketplace). If you run conan several times on the same project / solution, there is no problem, since it is checked that it not exists before adding it to project. Checked in this function: ConanService.IntegrateIntoConfiguration But, the check relies on Visual Studio property "VCConfiguration.PropertySheets" there
The problem appears when you delete conanbuildinfo.props (this could frequently append, since it's located in $(OutDir)). To reproduce the issue, do this:
- Create a Solution/Project that use conan.
- Run conan on this project --> conanbuildinfo.props is created and corectly added.
- Close Visual Studio to be sure.
- Delete $(OutDir) from your hard drive
- Open your Visual Studio solution (in my case, Visual has a lot of complains in its output window "error : Designtime build failed for project 'project' configuration 'Debug|x64'. IntelliSense might be unavailable. Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate."
- You can observe in Property Manager that Visual Studio doesn't see any reference to conanbuildinfo:
- Run conan --> a new property sheet is wrongly added to the project:
[Conan.VisualStudio] Property sheet '.......\x64\Debug.conan\conanbuildinfo.props' added to project FirstRectangle
And it's now visible twice in Property Manager:
I hope that it will help to find how to resolve this issue. Is it Microsoft responsibility, since Visual doesn't report this property sheet when it's not accessible?