Closed Pethical closed 3 years ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Since this is in triage for .Net 5, is there a workaround for this for .NetCore 3.1?
This issue is in the backlog for now. We'll re-evaluate if more people express interest in this.
As for work-arounds, I'd recommend adding a custom MSBuild task to prune out the directory after publish when under Release configuration.
if you don't use ClickOnce and publishing to the file system, you can use something like:
<!-- common.props - include in your *.csproj: <Import Project="$(relative_path)\common.props" /> -->
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- https://github.com/dotnet/aspnetcore/issues/25102 -->
<PublishProtocolProviderTargets>RemoveBlazorDebugProxy;$(PublishProtocolProviderTargets)</PublishProtocolProviderTargets>
</PropertyGroup>
<Target Name="RemoveBlazorDebugProxy" />
<Target Name="RemoveBlazorDebugProxy" Condition=" '$(Configuration)' == 'Release' ">
<RemoveDir Directories="$(PublishDir)\BlazorDebugProxy" />
</Target>
</Project>
Hints: https://github.com/dotnet/sdk/search?q=PublishProtocolProviderTargets
It's probably ok to close this issue because BlazorWebAssemblyOmitDebugProxyOutput
solves the original request in .NET 5. I found this answer on StackOverflow, and it works when I add the following to my Server project:
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<BlazorWebAssemblyOmitDebugProxyOutput>true</BlazorWebAssemblyOmitDebugProxyOutput>
</PropertyGroup>
@menees Good find! Thanks for sharing the solution. I actually no idea we had this condition in place when copying over the debug proxy assemblies so TIL.
Is your feature request related to a problem? Please describe.
I am trying to publish a blazor webassembly app (server hosted with web api), but I can't get rid of the BlazorDebugProxy directory. This is a very large directory and seems to be totally unwanted in production environments.
Describe the solution you'd like
I would like a switch/paraméter in the project file, what can ignore this files from the release builds, eg:
<BlazorDebugProxyEnabled>true|false</BlazorDebugProxyEnabled>
or simple ignore it without any switch when the configuration is release.Regards, Peter