We have one project that includes both a Razor Class Library and a WASM project. Both are .NET 5.0.
We test and demo the RCL using the WASM project which is published regularly and works fine.
We have created a nuget package of the RCL some time ago and used that successfully in a Blazor server-side project.
Now I am trying to reference the RCL in a new WASM project (also .NET 5.0) and I'm strangely getting this error:
<Target Name="_FailIfReferencingAspNetCoreApp" BeforeTargets="ResolveRuntimePackAssets">
<Error
Code="BLAZORSDK1001"
Text="The project references the ASP.NET Core shared framework, which is not supported by Blazor WebAssembly apps. Remove the framework reference if directly referenced, or the package reference that adds the framework reference."
Condition="'@(FrameworkReference->WithMetadataValue('Identity', 'Microsoft.AspNetCore.App')->Count())' != '0'" />
</Target>
Is there something I'm missing? This is the .csproj of the RCL, which I guess is relevant:
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<PackageId>BlazorUI5</PackageId>
<Version>1.0.39</Version>
<Authors>CEO Dev Team</Authors>
<Company>CEO Consultoría</Company>
<PackageDescription>Blazor UI5 component package</PackageDescription>
<RepositoryUrl>https://*******</RepositoryUrl>
<AssemblyVersion>1.0.39.0</AssemblyVersion>
<FileVersion>1.0.39.0</FileVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Helper\**" />
<Content Remove="Helper\**" />
<EmbeddedResource Remove="Helper\**" />
<None Remove="Helper\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.3" />
</ItemGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
</Project>
I find it strange that the reference works in the same solution, but it doesn't work using the package in another WASM solution, yet it does in another Blazor-server solution...
Any suggestions on what to check here?
Thanks,
Joerg