-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET 7 PublishReadyToRun causes crash when publishing, but it worked on .NET 6 #78278
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Presumably, the answer is the same as #78277 (comment) |
Here it says Windows 7 is still supported by .NET 7 |
https://learn.microsoft.com/en-us/windows/win32/api/evntprov/nf-evntprov-eventsetinformation EventSetInformation does not exisit on Windows 7. Seems that crossgen2 has dropped support for Windows 7. |
crossgen2 is compiled with NativeAOT and NativeAOT generates this import because WindowsAPIs.txt says it's safe to do so:
Without that entry, it would use LoadLibrary/GetProcAddress. Apparently there's a try/catch that catches the EntryPointNotFoundException at runtime: runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventProvider.cs Lines 1207 to 1218 in b6deba5
If Windows 7 is still supported, we'll probably have to go through the whole list and find APIs that don't exist on 7. The list was already supposed to do that, but looks like there was an issue seeding it:
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsDescriptionHello, I am experimenting .NET 7 on my project and I am having a problem with PublishReadyToRun. It causes the Reproduction StepsMy .csproj is as below. The referenced projects, Domain and Infrastructure, are vanilla, without any external dependencies, only pure .NET code. <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>Pororoca.Desktop</AssemblyName>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DebugType>embedded</DebugType>
<EnableCompressionInSingleFile>True</EnableCompressionInSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Pororoca.Domain\Pororoca.Domain.csproj"/>
<ProjectReference Include="..\Pororoca.Infrastructure\Pororoca.Infrastructure.csproj"/>
</ItemGroup>
<ItemGroup>
<Compile Update="**\*.xaml.cs">
<DependentUpon>%(Filename)</DependentUpon>
</Compile>
<AvaloniaResource Include="**\*.xaml">
<SubType>Designer</SubType>
</AvaloniaResource>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.18" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" />
</ItemGroup>
</Project> My dotnet publish ./src/Pororoca.Desktop/Pororoca.Desktop.csproj `
--verbosity quiet `
--nologo `
--configuration Release `
-p:PublishSingleFile=${publishSingleFileArg} `
--self-contained true `
--runtime $runtime `
--output $outputFolder Expected behaviorIt should publish without problems. Actual behaviorThe following message shows up on console and an error dialog also appears:
Regression?It worked without problems on .NET SDK 6.0.402. Known WorkaroundsNo response Configuration
Other informationRunning on Windows 7 x64.
|
Fortunately, we disable EventSource by default on NativeAOT so this is somewhat harder to hit for regular users. I made crossgen2 opt into EventSource because we actually wanted it to be enabled :/. |
When I have compiled this list, I have verified that all APIs in the list exist by running a script that did LoadLibrary+GetProcAddresses on Windows 7 test machine. I think that the problem is that this API was backported to Windows 7 by KB3080149 and the Windows 7 test machines have this KB installed. One way to fix this problem is to add this KB to the list of Windows 7 prerequisites at https://learn.microsoft.com/en-us/dotnet/core/install/windows?tabs=net60#additional-deps |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
.NET 7 does not have Windows 7 support: https://github.com/dotnet/core/blob/main/release-notes/7.0/supported-os.md. If this were a fundamental API in the runtime itself, I would consider fixing this anyway, but because this is specifically for the SDK, crossgen in particular, I don't think Windows 7 support is necessary. Users can publish on a Windows 10 machine and deploy to a Windows 7 machine. Development on Windows 7 itself is not a high priority. |
Description
Hello,
I am experimenting .NET 7 on my project and I am having a problem with PublishReadyToRun. It causes the
dotnet publish
process to crash.The project is an Avalonia desktop GUI.
Reproduction Steps
My .csproj is as below. The referenced projects, Domain and Infrastructure, are vanilla, without any external dependencies, only pure .NET code.
This is the repo for the project: link.
My
dotnet publish
full command is below; runtime iswin-x64
,PublishSingleFile
istrue
:Expected behavior
It should publish without problems.
Actual behavior
The following message shows up on console and an error dialog also appears:
Regression?
It worked without problems on .NET SDK 6.0.402.
Known Workarounds
No response
Configuration
dotnet --info
:Other information
Running on Windows 7 x64.
The text was updated successfully, but these errors were encountered: