In a webassembly project I created two Razor Class Libraries Software1 and Software2 and added a reference to both in the main client app.

I also added these to my client's Project file:

<ItemGroup>
  <BlazorWebAssemblyLazyLoad Include="Software1.dll"></BlazorWebAssemblyLazyLoad>
  <BlazorWebAssemblyLazyLoad Include="Software2.dll"></BlazorWebAssemblyLazyLoad>
</ItemGroup>

But when I build the project fails wi message:

 Error  BLAZORSDK1001   Unable to find 'Software1.dll;Software2.dll' to be lazy loaded 
later. Confirm that project or package references are included and the reference is used in 
the project.    OTS.UI.Client   C:\Users\..\.nuget\packages\microsoft.net.sdk.webassembly.pack\8.0.0\build
\Microsoft.NET.Sdk.WebAssembly.Browser.targets  372 

When I remove the <ItemGroup>s, Rebuild is successfull and Software1.dll and Software2.dll are there in the bin folder but when <ItemGroup> is present buld fails and bin folder's .net8 folder is empty. How to correct this?

0

There are 0 best solutions below