You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HelloWorldExample1.zip
When doing publishsinglefile=true and running resulting exe we get a runtime failure of hostpolicy.dll not found for dotnet 9.0.100. This is a regression from net8, where it builds and runs fine.
With C# project file is defined as: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net8.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <PlatformTarget>x64</PlatformTarget> <PublishSingleFile>true</PublishSingleFile> <SelfContained>true</SelfContained> <PublishTrimmed>true</PublishTrimmed> <RuntimeIdentifier>win-x64</RuntimeIdentifier> </PropertyGroup>
Set EXEOUT to some directory and build the project. Go to exeout directory at command prompt and run the executable and to get error:
c:\Temp\exeout>HelloWorldExample1.exe
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
Failed to run as a self-contained app.
The application was run as a self-contained app because 'c:\Temp\exeout\HelloWorldExample1.runtimeconfig.json' was not found.
If this should be a framework-dependent app, add the 'c:\Temp\exeout\HelloWorldExample1.runtimeconfig.json' file and specify the appropriate framework.
Removing the publishsinglefile allows program to run without error.
Versions:
dotnet 9.0.100
VS 17.12.1
csc 4.12.0-3.24558.5
The text was updated successfully, but these errors were encountered:
HelloWorldExample1.zip
When doing publishsinglefile=true and running resulting exe we get a runtime failure of hostpolicy.dll not found for dotnet 9.0.100. This is a regression from net8, where it builds and runs fine.
With C# project file is defined as:
<Project
Sdk="Microsoft.NET.Sdk"><PropertyGroup>
<OutputType>Exe</OutputType> <TargetFramework>net8.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <PlatformTarget>x64</PlatformTarget> <PublishSingleFile>true</PublishSingleFile> <SelfContained>true</SelfContained> <PublishTrimmed>true</PublishTrimmed> <RuntimeIdentifier>win-x64</RuntimeIdentifier> </PropertyGroup>
<Target
Name="PostBuild" AfterTargets="PostBuildEvent"><Exec Command="dotnet publish --configuration $(Configuration) --runtime win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=true --no-build --output=$(EXEOUT) HelloWorldExample1.csproj" />
</Target>
</Project>
Set EXEOUT to some directory and build the project. Go to exeout directory at command prompt and run the executable and to get error:
c:\Temp\exeout>HelloWorldExample1.exe
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
Failed to run as a self-contained app.
Removing the publishsinglefile allows program to run without error.
Versions:
dotnet 9.0.100
VS 17.12.1
csc 4.12.0-3.24558.5
The text was updated successfully, but these errors were encountered: