Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Packed dlls do not work with Blazor #45

Open
frankabbruzzese opened this issue Mar 15, 2020 · 0 comments
Open

Packed dlls do not work with Blazor #45

frankabbruzzese opened this issue Mar 15, 2020 · 0 comments

Comments

@frankabbruzzese
Copy link

I configured a client Blazor project with:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
    <RazorLangVersion>3.0</RazorLangVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="ILRepack.MSBuild.Task" Version="2.0.13" PrivateAssets="All" />
    <PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.2.0-preview1.20073.1" />
    <PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.2.0-preview1.20073.1" PrivateAssets="all" />
    <PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.2.0-preview1.20073.1" PrivateAssets="all" />
    <PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.2.0-preview1.20073.1" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\MvcControlsToolkit.Blazor.Simple\MvcControlsToolkit.Blazor.Simple.csproj" />
    <ProjectReference Include="..\Shared\MvcControlsToolkit.Blazor.Sample.Shared.csproj" />
  </ItemGroup>
  <Target Name="ILRepack" AfterTargets="Build" >
    <PropertyGroup>
      <WorkingDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)\$(TargetFramework)</WorkingDirectory>
    </PropertyGroup>
    <ItemGroup>
      <InputAssemblies Include="MvcControlsToolkit.Blazor.Sample.Client.dll" />
      <InputAssemblies Include="MvcControlsToolkit.Core.DataAnnotations.dll" />
      <InputAssemblies Include="MvcControlsToolkit.Blazor.DataAnnotations.dll" />
      <InputAssemblies Include="MvcControlsToolkit.Blazor.Metadata.dll" />
      <InputAssemblies Include="MvcControlsToolkit.Blazor.Simple.dll" />
    </ItemGroup>
    
    <Message Text="MERGING: @(InputAssemblies->'%(Filename)') into $(OutputAssembly)" Importance="High" />
    <ILRepack 
            OutputType="$(OutputType)" 
            MainAssembly="$(AssemblyName).dll" 
            OutputAssembly="$(WorkingDirectory)\dist\_framework\_bin\$(AssemblyName).dll" 
            InputAssemblies="@(InputAssemblies)"
            WorkingDirectory="$(WorkingDirectory)" />
  </Target>
</Project>

The pack task runs without errors. However, when running the code in the browser I wet the following error:

WASM: System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant