dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.46k stars 4.76k forks source link

net9 - Type System.Object is not blittable: Not a ValueType #110101

Open Dona278 opened 1 week ago

Dona278 commented 1 week ago

Is there an existing issue for this?

Describe the bug

After update a blazor wasm hosted project from net8 to net9 during build / publish I see this in the build output:

message WASM0060: Type System.Object is not blittable: Not a ValueType
message WASM0062: Type System.Runtime.InteropServices.HandleRef is not blittable: Field _wrapper is not blittable
warning WASM0001: Could not get pinvoke, or callbacks for method 'Microsoft.Build.Framework.NativeMethods::GetModuleFileName' because 'System.NotSupportedException: Unsupported parameter type in method 'Microsoft.Build.Framework.NativeMethods.GetModuleFileName'
warning WASM0001:    at PInvokeCollector.<CollectPInvokes>g__CollectPInvokesForMethod|6_0(MethodInfo method, <>c__DisplayClass6_0& )
warning WASM0001:    at PInvokeCollector.CollectPInvokes(List`1 pinvokes, List`1 callbacks, HashSet`1 signatures, Type type)'

However it seems to works good, but I don't know what generate this warning and what are the conseguences.

Expected Behavior

No see this warning in the output

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

9.0.100

Anything else?

.NET SDK: Version: 9.0.100 Commit: 59db016f11 Workload version: 9.0.100-manifests.c6f19616 MSBuild version: 17.12.7+5b8665660

Runtime Environment: OS Name: Windows OS Version: 10.0.22631 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\9.0.100\

.NET workloads installed: [wasm-tools] Installation Source: SDK 9.0.100 Manifest Version: 9.0.0/9.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.workload.mono.toolchain.current\9.0.0\WorkloadManifest.json Install Type: Msi

[wasm-tools-net8] Installation Source: SDK 9.0.100 Manifest Version: 9.0.0/9.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.workload.mono.toolchain.net8\9.0.0\WorkloadManifest.json Install Type: Msi

Configured to use loose manifests when installing new manifests.

Host: Version: 9.0.0 Architecture: x64 Commit: 9d5a6a9aa4

.NET SDKs installed: 8.0.404 [C:\Program Files\dotnet\sdk] 9.0.100-rc.2.24474.11 [C:\Program Files\dotnet\sdk] 9.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 9.0.0-rc.2.24474.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 9.0.0-rc.2.24473.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 9.0.0-rc.2.24474.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables: Not set

global.json file: C:\Sources\release\global.json

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download

javiercn commented 6 days ago

@Dona278 thanks for contacting us.

Do you see this during Linking/ AoT compilation?

Dona278 commented 6 days ago

@javiercn yes sorry!! I omitted probably the most important setup.. This is a blazor wasm hosted project with RCL referenced as nuget package and both AOT and Trimming enabled as full in the main project and partial in the RCL.

Dona278 commented 6 days ago

As soon as I find 5 minutes today I try to write you the exact moment during build but for now I remember the was just before linking the assemblies yes

dotnet-policy-service[bot] commented 4 days ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

Dona278 commented 4 days ago

As additional information. The warning appear also during normal build which AOT and Linking aren't involved in the process.