Skip to content

BlazorDebugProxy get copied as Content when using dotnet pack #63461

@datvm

Description

@datvm

Description

I am not sure why it's happening as I can't reproduce it with a new set of projects so I hope you can give me some pointers. I have two libraries projects (originally created as Blazor Web App): MyLib.Client and MyLib (which refers to MyLib.Client). My consuming projects will be Blazor Web Apps that use mostly static server-side rendering and some part are WebAssembly interactive.

  • MyLib.Client contains components that should be available to the Blazor WebAssembly.
  • MyLib contains some more components that are server rendered only.

Packing MyLib is fine, but I realized MyLib.Client was ~8MB, and unpacking the content, I found these files in the package's content folder (Texts is my own folder, the rest should not be there):

Image

I realized it's from the bin\Release\net8.0\BlazorDebugProxy folder.

This is my .csproj files, Client first and server second:

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

	<PropertyGroup>
		<!-- Nuget info -->
	</PropertyGroup>

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


	<ItemGroup>
		<SupportedPlatform Include="browser" />
	</ItemGroup>

	<ItemGroup>
		<PackageReference Include="BlazorMaterialWeb.Bundled" Version="2.1.0" />
		<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.17" />
		<PackageReference Include="ServiceSharp" Version="2.1.0" />
	</ItemGroup>
</Project>
	<PropertyGroup>
		<!-- Nuget info -->
	</PropertyGroup>
	
	<PropertyGroup>
		<TargetFramework>net8.0</TargetFramework>
		<Nullable>enable</Nullable>
		<ImplicitUsings>enable</ImplicitUsings>
		<LangVersion>preview</LangVersion>
		<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
		
		<NoWarn>NU5100</NoWarn> <!-- Nuget DLL -->
	</PropertyGroup>

	<ItemGroup>
		<FrameworkReference Include="Microsoft.AspNetCore.App" />

		<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.17" />

		<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
		<PackageReference Include="Serilog.Sinks.Seq" Version="9.0.0" />

		<PackageReference Include="BlazorMaterialWeb.Bundled" Version="2.1.0" />
		<PackageReference Include="ServiceSharp" Version="2.1.0" />
		<ProjectReference Include="..\ClientProject.csproj" />
	</ItemGroup>

Note: the <NoWarn>NU5100</NoWarn> <!-- Nuget DLL --> line is so that I can pack it due to it triggering only when running dotnet pack.

If I upload the Nuget package and use it anyway, when referring to the package, this happens:

Image

Reproduction Steps

N/A

Expected behavior

The DLLs should not be copied.

Actual behavior

Extra DLLs from BlazorDebugProxy copied.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions