conan-vs-extension icon indicating copy to clipboard operation
conan-vs-extension copied to clipboard

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

Open atanadan-flutterint opened this issue 1 year ago • 5 comments

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)

atanadan-flutterint avatar Jun 20 '24 11:06 atanadan-flutterint

Hi @atanadan-flutterint,

Thanks a lot for reporting. A couple of questions:

  • What Visual Studio version are you using?
  • Can you share a bit about the structure of the solution? Does it have multiple projects? Are all of them VC++ projects?
  • How is the LanguageStandard set un your IDE?

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 avatar Jun 20 '24 12:06 czoido

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

czoido avatar Jun 20 '24 12:06 czoido

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)

atanadan-flutterint avatar Jun 20 '24 13:06 atanadan-flutterint

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.

czoido avatar Jun 20 '24 13:06 czoido

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.

atanadan-flutterint avatar Jun 20 '24 14:06 atanadan-flutterint

I am also facing the same issue . Is there anyone knows the resolution to fix this issue please ping here . My project is running in VS2022 but initially built in VS2017 .

PrakashVenkatesan-8121 avatar Aug 20 '25 06:08 PrakashVenkatesan-8121

Hi @PrakashVenkatesan-8121,

The cause, as explained in the previous comment, is that the extension queries the LanguageStandard property, but that property is not available in projects using the v141 toolset. In those toolsets Visual Studio didn’t expose LanguageStandard in the project schema, so the extension fails when trying to read it. (Anything prior to v143 won’t define it.)

In order to be able to use the plugin you should update the project(s) to use the v143 toolset. Please make sure you update it in all configurations and platforms (Debug/Release, Win32/x64/ARM64, …). If even one configuration remains in v141, the error will still appear when building that configuration.

Once all configs are on v143 (or newer), the error should disappear.

Please, let us know if that solves your issue.

czoido avatar Aug 20 '25 07:08 czoido

Hi @PrakashVenkatesan-8121, @atanadan-flutterint

Were you able to get it working? Do you have any other questions?

czoido avatar Aug 28 '25 06:08 czoido