Skip to content
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 8 RC1 Regression: error BLAZORSDK1001: Unable to find '{dll list}' to be lazy loaded later. Confirm that project or package references are included and the reference is used in the project. #92965

Closed
aguacongas opened this issue Oct 3, 2023 · 3 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm
Milestone

Comments

@aguacongas
Copy link

Description

I upgrade exising Blazor WASM with lazy loaded assemblies project to .Net 8 SDK but I got this error when building it:

C:\Users\LefebvreO.nuget\packages\microsoft.net.sdk.webassembly.pack\8.0.0-rc.1.23419.4\build\Microsoft.NET.Sdk.WebAssembly.Browser.targets(368,5): error BLAZORS
DK1001: Unable to find 'Aguacongas.TheIdServer.BlazorApp.Pages.Api.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Apis.dll;Aguacongas.TheIdServer.BlazorApp.Pages.ApiS
cope.dll;Aguacongas.TheIdServer.BlazorApp.Pages.ApiScopes.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Client.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Clients.dll
;Aguacongas.TheIdServer.BlazorApp.Pages.Culture.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Cultures.dll;Aguacongas.TheIdServer.BlazorApp.Pages.ExternalProvider.dl
l;Aguacongas.TheIdServer.BlazorApp.Pages.ExternalProviders.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Identities.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Identi
ty.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Import.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Keys.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Role.dll;Aguaconga
s.TheIdServer.BlazorApp.Pages.Roles.dll;Aguacongas.TheIdServer.BlazorApp.Pages.User.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Users.dll;Aguacongas.TheIdServer.Bl
azorApp.Pages.RelyingParties.dll;Aguacongas.TheIdServer.BlazorApp.Pages.RelyingParty.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Settings.dll' to be lazy loaded la
ter. Confirm that project or package references are included and the reference is used in the project. [C:\Projects\Perso\TheIdServer\src\Aguacongas.TheIdServer.B
lazorApp\Aguacongas.TheIdServer.BlazorApp.csproj]

Reproduction Steps

  • Create a solution with a Razor class library project and a Blazor WASM project and reference the class library project in Blazor poject with assembly lazy loading:
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-rc.1.23421.29" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0-rc.1.23421.29" PrivateAssets="all" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\RazorClassLibrary1\RazorClassLibrary1.csproj" />
  </ItemGroup>

  <ItemGroup>
    <BlazorWebAssemblyLazyLoad Include="RazorClassLibrary1.dll" />
  </ItemGroup>

</Project>
  • Build
Rebuild started...
1>------ Rebuild All started: Project: RazorClassLibrary1, Configuration: Debug Any CPU ------
Restored C:\Users\LefebvreO\source\repos\BlazorApp1\RazorClassLibrary1\RazorClassLibrary1.csproj (in 290 ms).
Restored C:\Users\LefebvreO\source\repos\BlazorApp1\BlazorApp1\BlazorApp1.csproj (in 324 ms).
1>C:\Program Files\dotnet\sdk\8.0.100-rc.1.23455.8\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(311,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
1>RazorClassLibrary1 -> C:\Users\LefebvreO\source\repos\BlazorApp1\RazorClassLibrary1\bin\Debug\net8.0\RazorClassLibrary1.dll
2>------ Rebuild All started: Project: BlazorApp1, Configuration: Debug Any CPU ------
2>C:\Users\LefebvreO\.nuget\packages\microsoft.net.sdk.webassembly.pack\8.0.0-rc.1.23419.4\build\Microsoft.NET.Sdk.WebAssembly.Browser.targets(368,5): error BLAZORSDK1001: Unable to find 'RazorClassLibrary1.dll' to be lazy loaded later. Confirm that project or package references are included and the reference is used in the project.
2>Done building project "BlazorApp1.csproj" -- FAILED.
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========
========== Rebuild started at 10:23 PM and took 10.150 seconds ==========

Expected behavior

Should build without error

Actual behavior

Build error error BLAZORS
DK1001: Unable to find

Regression?

Yes, it was working with .Net 7

Known Workarounds

Disable assembly lazy loading

Configuration

SDK: 8.0.100-rc.1.23455.8
Running on 11 Enterprise 21H2
Processor: x64
Browser: Edge

Other information

No response

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 3, 2023
@ghost
Copy link

ghost commented Oct 3, 2023

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

I upgrade exising Blazor WASM with lazy loaded assemblies project to .Net 8 SDK but I got this error when building it:

C:\Users\LefebvreO.nuget\packages\microsoft.net.sdk.webassembly.pack\8.0.0-rc.1.23419.4\build\Microsoft.NET.Sdk.WebAssembly.Browser.targets(368,5): error BLAZORS
DK1001: Unable to find 'Aguacongas.TheIdServer.BlazorApp.Pages.Api.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Apis.dll;Aguacongas.TheIdServer.BlazorApp.Pages.ApiS
cope.dll;Aguacongas.TheIdServer.BlazorApp.Pages.ApiScopes.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Client.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Clients.dll
;Aguacongas.TheIdServer.BlazorApp.Pages.Culture.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Cultures.dll;Aguacongas.TheIdServer.BlazorApp.Pages.ExternalProvider.dl
l;Aguacongas.TheIdServer.BlazorApp.Pages.ExternalProviders.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Identities.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Identi
ty.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Import.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Keys.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Role.dll;Aguaconga
s.TheIdServer.BlazorApp.Pages.Roles.dll;Aguacongas.TheIdServer.BlazorApp.Pages.User.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Users.dll;Aguacongas.TheIdServer.Bl
azorApp.Pages.RelyingParties.dll;Aguacongas.TheIdServer.BlazorApp.Pages.RelyingParty.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Settings.dll' to be lazy loaded la
ter. Confirm that project or package references are included and the reference is used in the project. [C:\Projects\Perso\TheIdServer\src\Aguacongas.TheIdServer.B
lazorApp\Aguacongas.TheIdServer.BlazorApp.csproj]

Reproduction Steps

  • Create a solution with a Razor class library project and a Blazor WASM project and reference the class library project in Blazor poject with assembly lazy loading:
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-rc.1.23421.29" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0-rc.1.23421.29" PrivateAssets="all" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\RazorClassLibrary1\RazorClassLibrary1.csproj" />
  </ItemGroup>

  <ItemGroup>
    <BlazorWebAssemblyLazyLoad Include="RazorClassLibrary1.dll" />
  </ItemGroup>

</Project>
  • Build
Rebuild started...
1>------ Rebuild All started: Project: RazorClassLibrary1, Configuration: Debug Any CPU ------
Restored C:\Users\LefebvreO\source\repos\BlazorApp1\RazorClassLibrary1\RazorClassLibrary1.csproj (in 290 ms).
Restored C:\Users\LefebvreO\source\repos\BlazorApp1\BlazorApp1\BlazorApp1.csproj (in 324 ms).
1>C:\Program Files\dotnet\sdk\8.0.100-rc.1.23455.8\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(311,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
1>RazorClassLibrary1 -> C:\Users\LefebvreO\source\repos\BlazorApp1\RazorClassLibrary1\bin\Debug\net8.0\RazorClassLibrary1.dll
2>------ Rebuild All started: Project: BlazorApp1, Configuration: Debug Any CPU ------
2>C:\Users\LefebvreO\.nuget\packages\microsoft.net.sdk.webassembly.pack\8.0.0-rc.1.23419.4\build\Microsoft.NET.Sdk.WebAssembly.Browser.targets(368,5): error BLAZORSDK1001: Unable to find 'RazorClassLibrary1.dll' to be lazy loaded later. Confirm that project or package references are included and the reference is used in the project.
2>Done building project "BlazorApp1.csproj" -- FAILED.
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========
========== Rebuild started at 10:23 PM and took 10.150 seconds ==========

Expected behavior

Should build without error

Actual behavior

Build error error BLAZORS
DK1001: Unable to find

Regression?

Yes, it was working with .Net 7

Known Workarounds

Disable assembly lazy loading

Configuration

SDK: 8.0.100-rc.1.23455.8
Running on 11 Enterprise 21H2
Processor: x64
Browser: Edge

Other information

No response

Author: aguacongas
Assignees: -
Labels:

area-Debugger-mono

Milestone: -

@maraf maraf added arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm and removed area-Debugger-mono labels Oct 4, 2023
@ghost
Copy link

ghost commented Oct 4, 2023

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

Issue Details

Description

I upgrade exising Blazor WASM with lazy loaded assemblies project to .Net 8 SDK but I got this error when building it:

C:\Users\LefebvreO.nuget\packages\microsoft.net.sdk.webassembly.pack\8.0.0-rc.1.23419.4\build\Microsoft.NET.Sdk.WebAssembly.Browser.targets(368,5): error BLAZORS
DK1001: Unable to find 'Aguacongas.TheIdServer.BlazorApp.Pages.Api.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Apis.dll;Aguacongas.TheIdServer.BlazorApp.Pages.ApiS
cope.dll;Aguacongas.TheIdServer.BlazorApp.Pages.ApiScopes.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Client.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Clients.dll
;Aguacongas.TheIdServer.BlazorApp.Pages.Culture.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Cultures.dll;Aguacongas.TheIdServer.BlazorApp.Pages.ExternalProvider.dl
l;Aguacongas.TheIdServer.BlazorApp.Pages.ExternalProviders.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Identities.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Identi
ty.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Import.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Keys.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Role.dll;Aguaconga
s.TheIdServer.BlazorApp.Pages.Roles.dll;Aguacongas.TheIdServer.BlazorApp.Pages.User.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Users.dll;Aguacongas.TheIdServer.Bl
azorApp.Pages.RelyingParties.dll;Aguacongas.TheIdServer.BlazorApp.Pages.RelyingParty.dll;Aguacongas.TheIdServer.BlazorApp.Pages.Settings.dll' to be lazy loaded la
ter. Confirm that project or package references are included and the reference is used in the project. [C:\Projects\Perso\TheIdServer\src\Aguacongas.TheIdServer.B
lazorApp\Aguacongas.TheIdServer.BlazorApp.csproj]

Reproduction Steps

  • Create a solution with a Razor class library project and a Blazor WASM project and reference the class library project in Blazor poject with assembly lazy loading:
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-rc.1.23421.29" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0-rc.1.23421.29" PrivateAssets="all" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\RazorClassLibrary1\RazorClassLibrary1.csproj" />
  </ItemGroup>

  <ItemGroup>
    <BlazorWebAssemblyLazyLoad Include="RazorClassLibrary1.dll" />
  </ItemGroup>

</Project>
  • Build
Rebuild started...
1>------ Rebuild All started: Project: RazorClassLibrary1, Configuration: Debug Any CPU ------
Restored C:\Users\LefebvreO\source\repos\BlazorApp1\RazorClassLibrary1\RazorClassLibrary1.csproj (in 290 ms).
Restored C:\Users\LefebvreO\source\repos\BlazorApp1\BlazorApp1\BlazorApp1.csproj (in 324 ms).
1>C:\Program Files\dotnet\sdk\8.0.100-rc.1.23455.8\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(311,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
1>RazorClassLibrary1 -> C:\Users\LefebvreO\source\repos\BlazorApp1\RazorClassLibrary1\bin\Debug\net8.0\RazorClassLibrary1.dll
2>------ Rebuild All started: Project: BlazorApp1, Configuration: Debug Any CPU ------
2>C:\Users\LefebvreO\.nuget\packages\microsoft.net.sdk.webassembly.pack\8.0.0-rc.1.23419.4\build\Microsoft.NET.Sdk.WebAssembly.Browser.targets(368,5): error BLAZORSDK1001: Unable to find 'RazorClassLibrary1.dll' to be lazy loaded later. Confirm that project or package references are included and the reference is used in the project.
2>Done building project "BlazorApp1.csproj" -- FAILED.
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========
========== Rebuild started at 10:23 PM and took 10.150 seconds ==========

Expected behavior

Should build without error

Actual behavior

Build error error BLAZORS
DK1001: Unable to find

Regression?

Yes, it was working with .Net 7

Known Workarounds

Disable assembly lazy loading

Configuration

SDK: 8.0.100-rc.1.23455.8
Running on 11 Enterprise 21H2
Processor: x64
Browser: Edge

Other information

No response

Author: aguacongas
Assignees: -
Labels:

arch-wasm, untriaged, area-Build-mono, os-browser

Milestone: -

@maraf
Copy link
Member

maraf commented Oct 4, 2023

In .NET 8 there is a change in how managed dlls are delivered to the browser. Serving .dll files was causing problems with some antiviruses. We changed the default extension (and inner format) to .wasm and blazor lazy loading needs to change the file extension

@maraf maraf self-assigned this Oct 4, 2023
@maraf maraf added this to the 8.0.0 milestone Oct 4, 2023
@maraf maraf removed the untriaged New issue has not been triaged by the area owner label Oct 4, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm
Projects
None yet
Development

No branches or pull requests

2 participants