diff --git a/ConanProfilesManager.cs b/ConanProfilesManager.cs index fddb8ea..e3f5b7d 100644 --- a/ConanProfilesManager.cs +++ b/ConanProfilesManager.cs @@ -31,8 +31,17 @@ private string getConanArch(string platform) return archMap[platform]; } - private string getConanCompilerVersion(string platformToolset) + private string getConanCompilerVersion(string platformToolset, string vsVersion) { + if (Version.TryParse(vsVersion, out Version parsedVersion)) + { + // https://github.com/conan-io/conan/issues/16239 + if (parsedVersion.Major == 17 && parsedVersion.Minor >= 10) + { + return "194"; + } + } + var msvcVersionMap = new Dictionary(); msvcVersionMap["v143"] = "193"; msvcVersionMap["v142"] = "192"; @@ -106,7 +115,8 @@ public void GenerateProfilesForProject(Project project) string profilePath = System.IO.Path.Combine(conanProjectDirectory, profileName); string toolset = vcConfig.Evaluate("$(PlatformToolset)").ToString(); - string compilerVersion = getConanCompilerVersion(toolset); + string vsVersion = vcConfig.Evaluate("$(MSBuildVersion)").ToString(); + string compilerVersion = getConanCompilerVersion(toolset, vsVersion); string arch = getConanArch(vcConfig.Evaluate("$(PlatformName)").ToString()); IVCRulePropertyStorage generalRule = vcConfig.Rules.Item("ConfigurationGeneral") as IVCRulePropertyStorage; string languageStandard = generalRule == null ? null : generalRule.GetEvaluatedPropertyValue("LanguageStandard"); diff --git a/source.extension.vsixmanifest b/source.extension.vsixmanifest index 63e5d3a..e027d00 100644 --- a/source.extension.vsixmanifest +++ b/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + Conan Extension for Visual Studio Conan Extension for Visual Studio automates the use of the Conan C/C++ package manager for retrieving dependencies within Visual Studio projects. https://github.com/conan-io/conan-vs-extension