I am trying to build the examples in MicroStationSDK Update 12 and receive the following error:
Cannot find the .Net tools location for this toolset. VS2017_DotNetToolsDir was not defined, and registry lookup failed.
I have verified that VS2017 has the .NET desktop development, desktop development with C++ and Universal Windows Platform development workloads installed. I am also running the MicroStationSDK command window as Administrator.
Any suggestions on why I am getting this error?Thanks,
Larry
Hi Larry,
just did quick analysis (fulltext search, nothing special ;-):
VS2017_DotNetToolsDir is defined in VCVarsQueryRegistry2017.mki in this way:
%if !defined (VS2017_DotNetToolsDir) VS2017_DotNetToolsDir= $[@realpath $[@registryread "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\NETFXSDK\4.6/WinSDK-NetFx40Tools", "InstallationFolder"]] %if $(VS2017_DotNetToolsDir) == " " %error Cannot find the .Net tools location for this toolset. VS2017_DotNetToolsDir was not defined, and registry lookup failed. %endif %endif
Based on used registry key, maybe you have not NET 4.6 installed, but only e.g. 4.6.2, so the registry key is not found?
On my computer, I see these definitions:
I think it's bug, because when SDK requires NET 4.6.2, it should use tools from 4.6.2 and not 4.6.
If you will confirm there is no registry key for 4.6, I assume you can modify VCVarsQueryRegistry2017 to check for 4.6.2.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan,
I have 4.6.1 and 4.6.2 installed but NOT 4.6.
Larry Smart said:I have 4.6.1 and 4.6.2 installed but NOT 4.6.
Ok, so it's probably the reason.
But it's bug in SDK, because Update 12 prerequisities are defined as "NET 4.6.2" and there is no requirement to have NET 4.6 installed together with 4.6.2.
A quick fix is to modify the mentioned mki file.
I made the change you suggested and now I get a different error from VcVarsQueryRegistry2017:
Cannot find the .Net framework 64-bit version for this toolset. VS2017_FrameworkVersion64 was not defined, and registry lookup failed.
%if !defined (VS2017_FrameworkVersion64) VS2017_FrameworkVersion64=$[@realpath $[@registryread "HKEY_LOCAL_MACHINE/SOFTWARE/WOW6432Node/Microsoft/VisualStudio/SxS/VC7", "FrameworkVer64"]] %if $(VS2017_FrameworkVersion64) == " " %error Cannot find the .Net framework 64-bit version for this toolset. VS2017_FrameworkVersion64 was not defined, and registry lookup failed. %endif %endif
It seems something more (another installation) is required. I am not sure what SxS registry key belongs to what Visual Studio component.
I guess Robert Hook should be able to provide more details.
Regards,
You can also check in VS2017 installer whether you have all installed modules, mentioned in SDK annoucnement, really installed. Personally I really hate it, because every module / group represents a bunch of individual components, so why to don't specify exactly what components are required?
My feeling is that missing registry is caused by some VC or VS tools component, not NET.
Hi Larry Smart,
Both you and Jan (thank you btw.) are certainly in the correct area of "the problem". It appears in VcVarsQueryRegistry2017.mki on line 141 your value for the VS2017_FrameworkVersion64 is not returning an expected value or " " (also expected). So, in trying to cut to the chase, do you mind providing me an export of your registry key in question using this (slightly long) key-in from your developer shell?
reg EXPORT HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VC7 %temp%\%COMPUTERNAME%-VS-SxS-VC7.txt & start explorer.exe /e, /select,%temp%\%COMPUTERNAME%-VS-SxS-VC7.txt
Presuming the VC7 path exists it should export the key values into a .txt file and open Explorer w/the file hilighted so you can pass it along for review.
Thank you,Bob
Robert,
I get an error when I run this script:
ERROR: The system was unable to find the specified registry key or value.
If I look at the registry itself, I can see that the value is set to 15.0.
Ok, as I suspected Microsoft Visual Studio "VC" entry is no longer present to detect and locate the appropriate Microsoft .NET Framework versions in the default windows locations. Like mine below. Coincidentally, I was already looking into these entries for two future advancements/opportunities for two proposed upcoming SDK changes. For now (just for the MSCE SDK U12 release), do you mind downloading the attached .txt file, rename it to .reg so it can create a couple focused "missing registry entries" the SDK is expecting? They add the highlighted entries below and should correct the problem you are seeing. Please let me know if it helps resolve the issue.
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VC7] "FrameworkDir32"="C:\\Windows\\Microsoft.NET\\Framework\\" "FrameworkDir64"="C:\\Windows\\Microsoft.NET\\Framework64" "FrameworkVer32"="v4.0.30319" "FrameworkVer64"="v4.0.30319"
Bob,
I successfully added the registry keys but I still get the original error. I reverted the VCVarsQueryRegistry2017.mki back to the original version instead of keeping Jan's suggestion of changing it to 4.6.2. Was this the correct thing to do?
I'm about to leave for today but I can help resolve this issue in the morning.
Thanks,buildallexamples-Output.txt