Visual Studio Compiler- oder Run-Problem?
Hallo,
ich habe mit C# angefangen und wollte die Sprache erlernen. Jedoch stoße ich auf ein technisches Problem beim Ausführen meines Programmes in Visual Studio 2022. Es kommt die folgende Meldung im cmd-Fenster:
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.8'.
Ich bin wirklich planlos und habe alles versucht. Ich finde keine Tutorials, die es zeigen und weiß nicht, woher ich die hostpolicy.dll-Datei downloaden soll, um die in den Ordner hineinzufügen und ob es generell so einfach ist, zu lösen.
Ist jemand mit demselben Problem konfrontiert worden?
Im Internet wird ein abweichendes Problem angesprochen. Mir hilft hier noch nicht einmal Google weiter, da ich mich nicht damit auskenne.
Ich hoffe auf Hilfe von Profis
Danke an euch.
1 Antwort
Wär schön wenn du erklären würdest was das Problem war und warum es nicht funktioniert hat.
Aber wenn nicht, dann wirst du bissl weiter recherchieren müssen.
Okey dann fangen wir an
Die Erklärung fängt mit diesem Satz an
Update for dotnet core 2.0 and beyond: the file appname.runtimeconfig.json (for both debug and release configuration) is needed in the same path as appname.dll.
Ich verstehe nicht wie der das meint ist es ne Datei oder wie soll ich vorgehen
Wenn du keine appname.dll hast, dann versuch den Link:
Einen project.json file hast du sicher.
In Debug mode via VS2017, the application is running.
In my .csproj :
PackageReference Include="Microsoft.NETCore.DotNetHostPolicy" Version="1.1.2" PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" TargetFramework netcoreapp1.1
I have found this solution for project.json but how to apply it to .csproj?
"compilationOptions": { "emitEntryPoint": true }
Ich weiß nicht was ich mit den folgenden Befehlen anfangen soll, die mit PackageReference anfangen, also was der damit meint habe ich kA.
ich kenn diesen link schon....