conan-io / conan-vs-extension

Conan Extension for Visual Studio
https://marketplace.visualstudio.com/items?itemName=conan-io.conan-vs-extension
MIT License
59 stars 34 forks source link

[Bug] The "ConfigurationGeneral" rule is missing the "LanguageStandard" property #243

Open atanadan-flutterint opened 2 weeks ago

atanadan-flutterint commented 2 weeks ago

Installed the extension on an existing project, tried to add a dependency and I get before every build: image The language standard is set to C++17 on all configurations in the project(s)

czoido commented 2 weeks ago

Hi @atanadan-flutterint,

Thanks a lot for reporting. A couple of questions:

We can add some checks to avoid the error but I would like to try to reproduce in case is something more I'm missing.

czoido commented 2 weeks ago

Also, could you try to create a new project with the console application template and check if it still happens?

atanadan-flutterint commented 2 weeks ago

I'm using VS 2022 Community edition, Version 17.9.3 The solution has multiple projects, all of them VC++, but only one of them (from what I can determine) gives this error.

All projects were on the v141 platform toolset which doesn't have C/C++ Language Standards in the General tab of Project Properties. I tried switching to v143, updating the standard, applying, then returning to v141 which seems to resolve the issue. The project has not diff after doing that, so I don't know how that could have caused the fix/workaround.

I tried creating a new solution to test it there, but they are created with v143 and no error came up.

Dependencies are still not in the include path in either case, though. For example, if I add cereal/1.3.2 as a requirement in conandata.yml and build (logs show it being installed), I can't include anything under #include <cereal/...> (not sure if separate issue or related)

czoido commented 2 weeks ago

Ok, that makes sense, do you know which was the visual studio version where the projects were initially created?

For the includes not being recognized, as we are injecting the properties to the project programatically, sometimes Visual Studio can't reload the changes, could you please try to build again, check if it works and if it does not, close and open the solution and check if that works?

Thanks a lot.

atanadan-flutterint commented 2 weeks ago

The project is old, so I'm not very sure - pre VS 2012, most likely.

I've tried opening/closing/building/rebuilding multiple times but still nothing. From what I can see, I can include e.g. cereal from a newly created project but not from this preexisting one. I can't use one of our private dependencies on either project, but I'm not 100% sure what tries to change the registry since it is disabled by our organizaton.