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

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.

Related

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

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.

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.

self-contained asp.net core web api is getting:- Failed to initialize CoreCLR, HRESULT: 0x80131500 on Ubuntu 16.10-x64

I have a self contained asp.net core website, than I am able to run fine in windows 10, but when publishing for ubuntu.16.10-x64, and running it in ubuntu 16.10 x64 desktop version is getting a:
Failed to initialize CoreCLR, HRESULT: 0x80131500
I have run updates and upgrades of the os:
(sudo apt-get update, sudo apt-get upgrade)
I am executing the starting command as sudo.
The file has run permissions ( -rwxrwx--x )
TargetFramework is netcoreapp1.1.
libicu-dev is already the newest version (55.1-7ubuntu0.2).
How to go about troubleshooting the error?
Update 28/07/17
While it seems there are several related issues which can cause this (most seem to be dependency related), some users have reported that for Ubuntu 16.1 following the instructions on the get started page has resolved the error.
Several other fixes for various other scenarios are suggested on this thread.
In addition, as per https://github.com/dotnet/coreclr/issues/11417 - some instances may be due to an existing bug in the CoreCLR 1.1 - which does not sound likely to be fixed in this version. Migrating to version 2.0 is suggested as a workaround in that case.
Original answer:
To help with diagnosing the issue, you can enable detailed startup errors by specifying detailed error logging with .UseSetting("detailedErrors", "true") and .CaptureStartupErrors(true) as per the following example:
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseSetting("detailedErrors", "true")
.UseIISIntegration()
.UseStartup<Startup>()
.CaptureStartupErrors(true)
.Build();
host.Run();
}
Update 01/24/2018
the issue got resolved after moving to .net core 2.0

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.

Trying to Add-Migration - Exception in Package Manager Console: "Cannot get an instance of EnvDTE.DTE"

I have been migrating my project to Visual Studio 2015 RC. I have also refactored it into separate projects. Now I need to add a migration for a model change in entity framework but as soon as I open the Package Manager Console I get this error message:
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE At C:\Users...\Visual Studio 2010\Projects\MyProject\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:50 char:30
If I clear the console and try again, I get "an exception has been encountered" - with more information in the activity log. Inspect the activity log and the exception is:
System.ArgumentOutOfRangeException: Specified argument was out of the
range of valid values. Parameter name: span at
Microsoft.VisualStudio.Text.SnapshotSpan..ctor(ITextSnapshot snapshot,
Span span) at
NuGetConsole.Implementation.Console.WpfConsoleClassifier.GetClassificationSpans(SnapshotSpan
span) at
Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTagger.d__1.MoveNext()
at
Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.d__1.MoveNext()
I realised that I had removed some packages that I probably should not have. So I re-installed these:
ModelScaffolding 0.9.2
MvcScaffolding 1.0.9
T4Scaffolding 1.0.8
This appears to have taken the second exception (ArgumentOutOfRangeException) away. However, now when I try Add-Migration I get
Join-Path : Cannot bind argument to parameter 'Path' because it is
null. At C:\Users...\Visual Studio
2010\Projects\MyProject\packages\EntityFramework.6.1.0\tools\EntityFramework.psm1:713
char:27
I tried uninstalling and re-installing Entity Framework. I noticed during install that the Join-Path error was displayed again, but package-manager continued, and reported a successful install. I still got the error when I tried Add-Migration
Then I opened the solution in Visual Studio Express 2013. I still get the initial Cannot get an instance of EnvDTE.DTE error, but I can clear the console window and I can add a migration - Phew!
I'd still like to get rid of that error message...and use VS 2015...
There was an error in the NuGet VS extension. You can fix this by installing the latest NuGet (not available through VS yet). This may require an update of Powershell and/or Windows Management Framework.