There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'ios-arm64' - maui

I was using VS Enterprise 17.3 preview 1 but my trial was expiring so I download and installed VS Community 17.3 preview 1. I open my MAUI project and build and I get this error;
There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'maccatalyst-x64
I assume I must've missed something in the installation so I go back but all the relevant components are installed
I double check with the Enterprise installation and they match. I then go back to opening the project in VS Enterprise and now I get the same error there too!?
I've tried deleting bin/obj folders cleaning and rebuilding;
I've tried adding this to the .csproj
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
I've tried changing the TargetFrameworks from this:
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
To this (and a few other combinations):
<TargetFrameworks>net6.0-android;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
So I'm now stuck unable to build :( help pls

Turns out I had an error in a blazor file that the compiler wasn't referencing. The 'no runtime pack' error was a red herring and unrelated to the actual error.

Related

NU1102: Unable to find package Microsoft.Windows.SDK.BuildTools with version (>= 10.0.19041.8)

In my build pipeline, I have the following step:
I am getting the following error:
##[error]The nuget command failed with exit code(1) and error(NU1102: Unable to find package Microsoft.Windows.SDK.BuildTools with version (>= 10.0.19041.8)
When I go to the NuGet page for this package: Microsoft.Windows.SDK.BuildTools, I see that it only has one version: 10.0.18362.3-preview. I am not sure why the NuGet restore step is trying to get a higher version that does not exist. Why is this happening and how can I fix it? Note: this is my first Pipeline.
Agent Specification: Windows-2019.
From this page, you can see only two versions of the package Microsoft.Windows.SDK.BuildTools are listed:
10.0.19041.1
10.0.18362.3-preview
When open the page of version 10.0.19041.1, you can see the warning message to notify that this package version has been deprecated. But it seems that you can still download and install it.
I think the other package versions may have been permanently deleted by the owner due to some security vulnerabilities. So you no longer find them.
You can try to open your project using Visual Studio on your local machine, and change to use version 10.0.18362.3-preview in your program.

Cordova app for Windows, NuGet fails to get correct version of System.Collections.Specialized

I'm tearing my hair out trying to build a windows app using Cordova. The build error I'm getting is:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(377, 5):
error : The package System.Collections.Specialized with version 4.0.0
could not be found in C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\.
Run a NuGet package restore to download the package.
[C:\cygwin64\home\Owner\src\apps\mytestapp-
gen\platforms\windows\CordovaApp.Windows10.jsproj]
In visual studio, I attempt to add the version of the package to the project and I get the following error:
Severity Code Description Project File Line Suppression State
Error Could not install package 'System.Collections.Specialized
4.0.0'. You are trying to install this package into a project that targets
'native,Version=v0.0', but the package does not contain any assembly
references or content files that are compatible with that framework. For
more information, contact the package author.
Can anyone advise how to resolve this?
I've looked at this very old question How can I make my managed NuGet package support C++/CLI projects? but I can't find anything (particually from the VS2017 era) that helps
May be, this helps others to solve the issue:
My Visual Studio 2017 installation must obviously have been damaged when removing the Visual Studio 2015 installation from that same machine. After I performed a repair of Visual Studio 2017 via Visual Studio Installer the isuue disappeared.

UWP Deployment Microsoft.NET.Native.Runtime.1.7 not found error

I have recently installed a few updates to windows / visual studio 2017, and now when I create a package of my UWP app and try deploying it to any of the machine where it used to work just fine - installation fails and there is this error message in windows error log:
AppX Deployment operation failed for package 92211ab1-5481-4a1a-9111-a3dd87b81b72_1.0.26.0_neutral_~_n78qa84z3g9aj with error 0x80073CF3. The specific error text for this failure is: Windows cannot install package 92211ab1-5481-4a1a-9111-a3dd87b81b72_1.0.26.0_x86__n78qa84z3g9aj because this package depends on a framework that could not be found. Provide the framework "Microsoft.NET.Native.Runtime.1.7" published by "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x86 processor architecture and minimum version 1.7.25531.0, along with this package to install. The frameworks with name "Microsoft.NET.Native.Runtime.1.7" currently installed are: {}
I can not find any reference on the web for this package.
The package installs just fine on the developement machine.
Any help would be greatly appreciated.
EDIT 1:
Screenshot of my dependencies folder below:
UWP Deployment Microsoft.NET.Native.Runtime.1.7 not found
The problem is that there is no Microsoft.NET.Native.Runtime.1.7 dependence in current OS system. And you could install Microsoft.NET.Native.Runtime.1.7 dependence manually.
The Microsoft.NET.Native.Runtime.1.7 dependence will be stored in the Dependencies folder where under the appx folder.
Update1
I have checked your screenshot. It seems that you generate your package in debug mode and I can reproduce the same dependency in this way. The .NET Native tool chain is checked by default in the release mode. So you could regenerate your package in release mode to get files above.
Looks like these dependencies only appear on a Release build, and not in Debug.

Omnisharp and DotNET Core Debugger on Windows 10 32-Bit

I just installed Visual Studio Code and the DotNET Core SDK on a fresh Windows 10 32-Bit machine. However, I don't get it to run and to work properly.
I've loaded the csharp extension (Omnisharp) in Visual Studio Code. It is obvious that it seems to load x64 packages instead of x86:
[INFO] Starting OmniSharp at 'd:\Entwicklung\MyFirstApp'...
[INFO] Installing to C:\Users\Daniel\.vscode\extensions\ms-vscode.csharp-1.1.5\.omnisharp
[INFO] Attempting to download omnisharp-1.9-beta5-win-x64-net451.zip...
[INFO] Downloading to C:\Users\Daniel\AppData\Local\Temp\tmp-1252lY4HMeX6qNhB.tmp...
This leads to the error that the Debugger cannot be installed:
Error: Can not find runtime target for framework '.NETStandardApp,Version=v1.5' compatible with one of the target runtimes: 'win10-x86, win81-x86, win8-x86, win7-x86'. Possible causes:
1. The project has not been restored or restore failed - run `dotnet restore`
2. The project does not list one of 'win10-x86, win81-x86, win8-x86, win7-x86' in the 'runtimes' section.
Error:
System.InvalidOperationException: Can not find runtime target for framework '.NETStandardApp,Version=v1.5' compatible with one of the target runtimes: 'win10-x86, win81-x86, win8-x86, win7-x86'. Possible causes:
1. The project has not been restored or restore failed - run `dotnet restore`
2. The project does not list one of 'win10-x86, win81-x86, win8-x86, win7-x86' in the 'runtimes' section.
at....
How to fix this?
Thanks!
I have a netbook that I was hoping to use with Windows 7 32 bit and VSCode / Omnisharp and I have hit that wall as well.
Omnisharp only supports 64 bit at the moment. There is no known plan for a 32 bit version.
What is confusing is that it USED to be 32 bit compatible! Either make the switch to 64 bit (if your hardware allows it) or set up a different tool chain (perhaps using SharpDevelop?).
People have already requested this change but the devs don't seem to take it seriously.

Running "ngen install EntityFramework.dll" fails with error 0x800706BE and 0x80131F06

As advised by the Entity Framework Team I've tried to create a native image of EntityFramework.dll with this command:
ngen install packages\EntityFramework.6.1.0-beta1\lib\net40\EntityFramework.dll
this results in the error 0x80131F06 (no native image for mscorlib.dll). When I now try to run ngen install mscorlib.dll I get the error 0x800706BE (RPC_S_CALL_FAILED - The remote procedure call failed).
I already used sfc /scannow and it reports no broken files.
Any ideas what is wrong here?
I fixed the issue myself. It is caused by the enabled DeveloperMode which was set by Redgates .NET Reflector VisualStudio Addon. Disabling it with this entry in the machine.config fixed it:
<runtime>
<developmentMode developerInstallation="false"/>
</runtime>
Now I have a native Image for mscorlib and I can ngen EF.