I must be the most clever guy in the world, installing Visual Studio on the same machine as Delphi thinking things couldn't go wrong
I must be the most clever guy in the world, installing Visual Studio on the same machine as Delphi thinking things couldn't go wrong
So, I ended up breaking MSBUILD, ie, got the "MSBuildToolsPath is not specified for the ToolsVersion" described here with the fix https://zoomicon.wordpress.com/2017/03/06/fix-delphi-error-msbuildtoolspath-is-not-specified-for-the-toolsversion/
Now I can compile fine from the IDE, but I cannot run MSBUILD scripts, like this:
call "DelphiPath\rsvars.bat"
msbuild /verbosity:detailed /p:config=release MyProject.dproj
This build fails with the following message:
"Path-To-.dproj" (default target) (1) ->
(SetMakeOptions target) ->
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.tasks(39,196): error MSB4066: The attribute "Runtime" in element is unrecognized.
I couldn't found anything on the "Runtime" attribute.
Full Delphi reinstall didn't help
I installed the Microsoft Build Tools 2015 (link from blog post above)
Checked Windows Registry Keys and all DefaultToolsVersion points to "14.0"
On Program Files(x86)\MSBuild y have a 14.0 and a 15.0 folder (15.0 does not have any binaries, whereas 14.0 does)
For the record, this is the output of the msbuild /ver command, launching from RAD Studio Command Prompt:
Microsoft (R) Build Engine, versión 3.5.30729.8763
[Microsoft .NET Framework, versión 2.0.50727.8745]
Copyright (C) Microsoft Corporation 2007. Reservados todos los derechos.
3.5.30729.8763
Any toughts?
So, I ended up breaking MSBUILD, ie, got the "MSBuildToolsPath is not specified for the ToolsVersion" described here with the fix https://zoomicon.wordpress.com/2017/03/06/fix-delphi-error-msbuildtoolspath-is-not-specified-for-the-toolsversion/
Now I can compile fine from the IDE, but I cannot run MSBUILD scripts, like this:
call "DelphiPath\rsvars.bat"
msbuild /verbosity:detailed /p:config=release MyProject.dproj
This build fails with the following message:
"Path-To-.dproj" (default target) (1) ->
(SetMakeOptions target) ->
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.tasks(39,196): error MSB4066: The attribute "Runtime" in element
I couldn't found anything on the "Runtime" attribute.
Full Delphi reinstall didn't help
I installed the Microsoft Build Tools 2015 (link from blog post above)
Checked Windows Registry Keys and all DefaultToolsVersion points to "14.0"
On Program Files(x86)\MSBuild y have a 14.0 and a 15.0 folder (15.0 does not have any binaries, whereas 14.0 does)
For the record, this is the output of the msbuild /ver command, launching from RAD Studio Command Prompt:
Microsoft (R) Build Engine, versión 3.5.30729.8763
[Microsoft .NET Framework, versión 2.0.50727.8745]
Copyright (C) Microsoft Corporation 2007. Reservados todos los derechos.
3.5.30729.8763
Any toughts?
Perhaps you already do this but I just thought to ask; the call to rsvars and the call to MSBUILD take place in the same console session, right?
ReplyDeleteYep. Script was working fine. Also launching from RAD studio command prompt doesn't work
ReplyDeleteThe env variables are not populated correctly. have you checked them in the control panel?
ReplyDeleteAFAIK rsvars.bat should set everything needed to build and don't rely on any specific env vars
ReplyDeleteYes that is correct but things get messed up often
ReplyDeleteThen, I suppose the rsvars is the correct file, right?
ReplyDeleteMy fellow MVP Matthew Vesperman had reported the same problem. His solution: "Simply download and install [Microsoft Build Tools 2015|https://www.microsoft.com/en-us/download/details.aspx?id=48159]"
ReplyDelete/sun
ReplyDeleteUwe Raabe thanks, but I've tried that already
ReplyDeleteJohn Kouraklis yes, I've never changed that file, and also it's a fresh Delphi install
ReplyDeleteDid you try it on a plain English windows install?
ReplyDeleteJeroen Wiert Pluimers no, my Windows language is Spanish, but I wouldn't think that's the problem. I think either visual studio replaced some shared dependency, or it changed some reg key or configuration file that messed up Delphi. FWIW the same script for Delphi 2010 runs fine. Cannot test on another version since Berlin starter doesn't support command line compiling
ReplyDeleteAlso the script runs fine on other machines. Well it's the CI server script, I can live without that on my dev machine
ReplyDeleteis there a System Restore Point where you can roll back?
ReplyDeleteNope. The thing that really bogs my out is that I couldn't find anything regarding such missing or misconfiguring attribute
ReplyDeleteJapanese translation of twitter.com - あえとす 2017-alpha.3 on Twitter isn't that helpful apart from that this is indeed a valid element: https://msdn.microsoft.com/en-US/library/t41tzex2.aspx
ReplyDeleteRichard Baroniunas yes, a VM for each dev tool is the way to go. Not sure what cross my mind the moment I decided to install VS.
ReplyDeleteThe solution on the link is the same of the OP. In fact, the blog post from zoomicon refers to that emba blog post
Agustin Ortu It happens to all of us...hope you figure it out soon as I know such things eat your time and challenge your temper
ReplyDeleteThe issue is when VS is uninstalled it does not clear the registry out properly the error comes from MSbuild. The key is left in there but everything else is empty.
ReplyDelete1) run regedit
2) go to this registry key
3) delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\MSBuild\ToolsVersions\14.0" (or what ever path it complains about in the future (this is on a 64 bit system drop the WOW6432Node on 32bit system))
4) try the IDE again
more info on the keys the various flavour of VS uses...
msdn.microsoft.com - Standard and Custom Toolset Configurations
Roy Nelson thanks, will give a try on the afternoon
ReplyDeleteI managed to make it work by installing MSBuild 12.0 and deleting 14.0 from registry and updating all keys DefaultToolsVersion to 12.0
ReplyDeleteThanks everyone