dotnet / runtime

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

When publishing from cli not working #105725

Closed wisamidris7 closed 1 month ago

wisamidris7 commented 1 month ago

Description

When I publish my blazor webassembly 8.0 application as aot from visual studio 2022 it worked But when publishing from cli it didn't work And this is the csproj

<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

    <PropertyGroup>
        <TargetFramework>net8.0</TargetFramework>
        <Nullable>enable</Nullable>
        <RunAOTCompilation>true</RunAOTCompilation>
        <WasmStripILAfterAOT>true</WasmStripILAfterAOT>
        <PublishTrimmed>false</PublishTrimmed>
        <ImplicitUsings>enable</ImplicitUsings>
        <ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.2" />
        <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.2" PrivateAssets="all" />
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Include="..\WebApp.Library\WebApp.Library.csproj" />
    </ItemGroup>

</Project>

And the command is this

dotnet publish C:\Users\{...}\WebApp.Wasm.csproj -c Release -r browser-wasm -o C:\Users\{...}\output\

This didn't work and it says the same problem that this man got

https://github.com/dotnet/runtime/issues/97634

But my csproj was not containing that

<EmccInitialHeapSize>22675456</EmccInitialHeapSize>

And I added that line and multiplied that number with * 5 And also it didn't work.

Reproduction Steps

.

Expected behavior

.

Actual behavior

.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

wisamidris7 commented 1 month ago

Also the problem returned that

C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.5\Sdk\WasmApp.Native.targets(418,5): error MSB3073: The command "llvm-size.exe -d --format=sysv {long long long long text}" exited with code 9020. [C:\Users\{...}\WebApp.Wasm.csproj]
wisamidris7 commented 1 month ago

I figured out that i need a calcuation to do this.