VS 2019 could not find SDK - visual-studio

I keep getting this error, I am trying to perform the unity MRTK tutorial for hololens 2. I did everything on the first page https://learn.microsoft.com/en-us/windows/mixed-reality/mr-learning-base-02. When I try and run it this error comes up. I have tried to install 10.0.19041.0 through windows but it always kicks to 19041.1 I have installed all the required components in visual studio.
Any help would be appreciated.
Error pic
Installed Vs individual components
Unity Build settings

The problem you met is a bug seemingly caused by vs installer. It happens when Visual Studio is not installed on driver C.
You can see it here:
https://developercommunity2.visualstudio.com/t/HoloLens-2-build-fails-if-Windows-sdk-is/1313568
There are many ways you could do to get through this.
Copy the folder [Windows Kit Root Dir]\10\Extension SDKs\WindowsMobile (For e.g., D:\Windows Kits\10\Extension SDKs\WindowsMobile) to C:\Program Files (x86)\Windows Kits\10\Extension SDKs\. Should solve all of the missing WindowMobile issues.
https://developercommunity.visualstudio.com/t/msb3774-could-not-find-sdk-windowsmobile-version10/402362#T-N474809
Delete the reference to the Mobile SDK in the vxcproj file.
https://stackoverflow.com/a/60600054/9522354
I tried the first method and it worked for me.

I have tried to install 10.0.19041.0 through windows but it always kicks to 19041.1
For how to modify the SDKReference version, you can try following step:
By referring Section 5 of Update your C#/VB projects to use the latest Universal Windows Platform
Right-click your existing project(YourProjectName(Universal Windows)) in solution explorer, then select Unload Project. After the project is unloaded, right-click the project file again and choose to edit the .vcxproj file.
Find "SDKReference" element and change the value of version from "10.0.19041.1" to your version like "10.0.19041.0".
<ItemGroup>
<SDKReference Include="WindowsMobile, Version=10.0.19041.1" />
</ItemGroup>
to
<ItemGroup>
<SDKReference Include="WindowsMobile, Version=10.0.19041.0" />
</ItemGroup>
Besides, since you are using HoloLens2, it is recommended to set the Architecture in the Unity Build Setting window to x64.

Related

Review Solution Actions: Retarget Projects - how to suppress it?

The following dialog prompts me to upgrade the platform toolset and Windows SDK version of files generated for VS2017 when opening it in VS2019:
How can I suppress this and have the action being taken to be No Upgrade?
After all I can still opt to do that later on via the context menu when right clicking a project in the Solution Explorer:
devenv.com from Visual Studio 2019 has:
/Upgrade Upgrades the project or the solution and all projects in it.
A backup of these files will be created as appropriate. Please
see Help on 'Visual Studio Conversion Wizard' for more
information on the backup process.
... what I'd like is essentially the opposite, though. And I'd also like for that setting to persist.
Note: while the screenshots were taken with Visual Studio 2019, earlier Visual Studio versions (notably since 2012) show this behavior as these appear to be the ones to support multiple platform toolsets and Windows SDKs in parallel. Therefore I am also tagging visual-studio.
Searching the options I came up emptyhanded when looking for:
action
retarget
target
upgrade
sdk
platform
toolset
You can suppress this dialog per-project by editing the project file, ProjectName.vcxproj.
It is an XML file. You can edit it with any text editor. Inside the <Project> tag, add the following lines:
<PropertyGroup Label="Globals">
<VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
</PropertyGroup>
Source: https://learn.microsoft.com/visualstudio/extensibility/visual-cpp-project-extensibility#disable-project-upgrade

TypeScript VsTsc error in Visual Studio 2017

I'm testing migration from VS 2015 to VS 2017 for a .NET Core / TypeScript project.
The build fails in VS 2017 with this error in Microsoft.TypeScript.targets:
MSB4064 The "PreferredUILang" parameter is not supported by the "VsTsc" task. Verify the parameter exists on the task, and it is a settable public instance property.
The version of TypeScript in VS 2017 is 2.1.5, however, I have already installed the 2.2.1 SDK for Visual Studio 2015.
I've also noted that there is no 2.2+ SDK release for Visual Studio 2017 yet.
Could this be causing conflicts? Is this something I can resolve now or do I need to wait for an update to the TypeScript SDK for VS 2017 to reach 2.2.1+?
Any help in this area appreciated!
This might be a bit of crude solution to the problem but we simply went through the "Microsoft.TypeScript.targets" file and removed PreferredUILang="$(PreferredUILang)" from any <VsTsc ... > nodes, we had a look into the Typescript task dll and it seems that it does not have a PreferredUILang property.
It is possible that the task once upon a time did have such a property but was removed and Microsoft have forgotten to update the targets file, I'm not sure but this seems to be working for us at least.
Please make sure you backup your "Microsoft.TypeScript.targets" file before editing.
I have same problem here in VS2015 Update 3 and I also fixed the Microsoft.TypeScript.targets, as suggested by ginja, but as I don't like to hack the nuget packages I went deeper in the issue.
The real problem is that when you add/upgrade the typescript nuget package, you have to manually remove the imports to the machine-wide targets and props. having both leads to unknown load order or targets/tasks, which would manifest in such errors.
So the approach I used is:
Uninstall from the project the nuget packages "Microsoft.TypeScript.Compiler" and Microsoft.Typescript.MSBuild"
Close VS (to guarantee the real clean of such package)
Edit you .csproj file commenting out the imports to the machine-wide targets and props: (all <Import Project="$(MSBuildExtensionsPath32)\Microsoft\...
Restart VS, open the project and add again the nuget packages for Typescript. This point correctly updates your .csproj with the correct imports and configuration of the TypeScript compiler.
Just for a clean safe: restart VS.
removing following lines from CSPROJ solved problem for me
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\WebApplications\Microsoft.WebApplication.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\WebApplications\Microsoft.WebApplication.targets')" />
to edit csproj file
Right click the project in Solution Explorer.
Select "Unload project"
Project is now unloaded.
Right click the project again and select
"Edit blah.csproj"
Make your changes and save them.

How do I add ArcObjects Version to a Visual Basic project?

I am developing a Visual Basic project in Visual Studio 2010 that uses ArcObjects. (I have ArcGIS 10.3 for Desktop.) I am getting the error "'RuntimeManager' is not declared. It may be inaccessible due to its protection level." A previous answer, Esri ArcObjects--Esri.ArcGIS.Version assembly, recommended adding a reference to Esri.ArcGIS.Version by clicking on Project, Add Reference, selecting it under .NET and clicking OK. I have tried to do this, but it's not under .NET. What can I do to make it available?
You should be able to find it if you use the Browse option.
The ESRI.ArcGIS.Version.dll file should be under your DeveloperKit installation folder. For me it is:
C:\Program Files (x86)\ArcGIS\DeveloperKit10.2\DotNet

Build Customization for CUDA 5.0 not found in Visual C++

I am trying my hand at CUDA gpu programming for the first time and have come across a problem when setting the build customization. I'm not sure if I'm just doing something wrong or not. Basically, when I set the projects build customization to CUDA 5.0, it doesn't work. I try to make a .cu (and even .cpp) file and I get an error stating:
The imported project "C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomization\CUDA
5.0.props"was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
c:\Users\"USER NAME"\documents\visual studio 2010\Projects\"PROJECT
NAME"\"PROJECT NAME".vcxproj
Afterwards the project property page becomes empty with only a Frameworks and References page which is empty. Turning off the CUDA declaration does nothing.
I have tried uninstalling the CUDA toolkit and reinstalling it but to no avail.
I'm pretty new at this, but any help would be appreciated!
In order to use CUDA build customization, some files should be copied to Visual Studio folders, in your case CUDA 5.0.props is missing from
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomization\
In order to fix this, search for CUDA 5.0.props in your C: drive and copy it to the above path.
This happened to me just now and the solution I did was re-run the CUDA installer and make sure to select Visual Studio integration.
This can also happen if you don't have CUDA installed on the machine. This could be quite common for instance you might be using your laptop to develop the project and it has no CUDA card. Anyway to fix this you need to edit the Visual Studio project file .vcxproj (anyone from NVIDIA listening?)
change
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 8.0.props" />**
to
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 8.0.props" Condition="exists('$(VCTargetsPath)\BuildCustomizations\CUDA 8.0.props')" />
and then
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 8.0.targets" />
to
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 8.0.targets" Condition="exists('$(VCTargetsPath)\BuildCustomizations\CUDA 8.0.targets')" />
Then right click on the project icon in visual studio and select the reload option, the project should reload, even if you haven't got CUDA installed on that particular machine.
You might have to do some further steps, eg. use #ifdef
to exclude these include files and other cuda code sections.

Cannot compile .NET CF project containing Design time attributes without Visual Studio?

I'm working on a .NET Compact Framework 3.5 app. I have an automated build machine that does not have Visual Studio installed, and all has been fine.
I'm trying to a a new solution containing control projects that have DesignTimeAttributes.xmta files. MsBuild on the build machine is failing with cannot find file, C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin\genasm.exe.
I've tried manually adding this directory and it's contents from my dev box to the build machine, but now I'm getting
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.Common.targets(67,9): error : genasm.exe(1) : error There was an error reading arguments. Could not load file or assembly 'Microsoft.CompactFramework.Build.Tasks, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Done executing task "BuildAsmmeta" -- FAILED.
Before I struggle further with this, I thought I'd ask if anyone else out there has gotten a CompactFramework project with design time attributes building on a machine without Visual Studio?
Filburt: I've already installed the Windows SDK, the .NET SDK, and the CF SDK. I realize now that "all has been fine" in the original question doesn't make that clear.
None of the SDK's installed anything into the Microsoft Visual Studio 9.0 directory.
I've given up and installed VS at this point, but thanks for the answer.
You think need to install the Windows .NET Framework SDK on your build machine to obtain the tools that come with Visual Studio.
update
Since you stated you installed all SDKs you could check %ProgramFiles%\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.cmd for any quirks in the PATH settings. I discovered some inconsistencies there for an x64 environment.

Resources