Closed DKroot closed 6 years ago
Hello,
I had the same issue until I changed the ToolsVersion="12.0"
to ToolsVersion="14.0"
in the csproj. This is because 12.0 is an unknown tools version so the plugin automatically bump to the tools version of MSBuild in the ProjectFileParser (i.e. 14.1).
Regards
Hello all,
I have just installed visual studio enterprise 2015 edition. I get the error attached when i tried to create a new project.
I am new to visual studio and lost as to what to do next. Pls help
@Itzkwat That doesn't seem to be from this plugin, but rather from the project you're trying to open :)
I've got the same problem with 4.16. I use VS 2015 Community edition
Error during project file parsing: Microsoft.Build.Exceptions.InvalidProjectFileException: The tools version "14.1" is unrecognized. Available tools versions are "14.0", "2.0", "3.5", "4.0". D:\dev\Webservices\WonderLib\WonderLib.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
at Microsoft.Build.Evaluation.Project.Data.InitializeForEvaluation(IToolsetProvider toolsetProvider)
at Microsoft.Build.Evaluation.Evaluator4..ctor(IEvaluatorData
4 data, ProjectRootElement projectRootElement, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary1 environmentProperties, ILoggingService loggingService, IItemFactory
2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, ProjectInstance projectInstanceIfAnyForDebuggerOnly)
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation)
at Microsoft.Build.Evaluation.Project.Initialize(IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary
2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary2 globalProperties, String toolsVersion) at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName) at ProjectFileParser.ProjectHelpers.LoadProject(String fullPath, IDictionary
2 args)
at ProjectFileParser.ProjectHelpers.<>c__DisplayClass0_0.2.MoveNext() at System.Linq.Buffer
1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)
at ProjectFileParser.ProjectHelpers.GetProjects(SolutionFile solution, IDictionary`2 args)
at ProjectFileParser.Program.ParseSolution(String file, JObject args)
at ProjectFileParser.Program.Parse(String file, JObject args)
at ProjectFileParser.Program.Main(String[] args)
Did you try to update the csproj's ToolsVersion as per @adescamps-ullink 's comment?
No, I didn't.
I do not want to manually change these files (I have no trouble to open them in VS anyway)
Now I directly used command line MSBuild.exe mysolution.sln
to build my solution
@ngyukman @adescamps-ullink I think we should take the highest of available, or maybe the closest to the one requested 🤔
I've upgraded to com.ullink.gradle:gradle-msbuild-plugin:2.18 and am trying to build a simple vs2017 project (that, of course, builds in visual studio 17) and am getting the error above, i.e.; Error during project file parsing: Microsoft.Build.Exceptions.InvalidProjectFileException: The tools version "14.1" is unrecognized I too don't want to change a visual studio maintained file from ToolsVersion="15.0" to ToolsVersion="14.0". Where is the code that converts the "15.0" to "14.1"? Thanks in advance, Jim
hi @JamesPoli
can you test the latest plugin? There is a fix around the tools version in https://github.com/Ullink/gradle-msbuild-plugin/releases/tag/2.19
Ok, will do! I'll post back with the results.
Ng Yuk Man, that worked. I believe it was a red herring though, I had VS2017 Professional and Enterprise installed on my machine, and only used the Professional version. It appears code that looks for the VS version must have gotten mixed up. I completely uninstalled all VS2017 versions and re-installed only VS2017 Professional and it's all good.
I have a build that runs find with plug-in 2.12. I'm using VS 2015 and MS Build 14.0.
Here is my full msbuild configuration:
In 2.13+ builds fail with:
Error during project file parsing: Microsoft.Build.Exceptions.InvalidProjectFileException: The tools version "14.1" is unrecognized. Available tools versions are "14.0", "2.0", "3.5", "4.0".
This might have to do something with children projects. I have two child projects defined and configured in a similar way (to above). If I disable children projects, my main project passes.