Insert executable into NuGet package
This commit is contained in:
Родитель
495a276d05
Коммит
46a13a90df
|
@ -0,0 +1,4 @@
|
|||
|
||||
{
|
||||
"rollForwardOnNoCandidateFx": 2
|
||||
}
|
|
@ -1,18 +1,19 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<PackageId>Microsoft.AspNetCore.Components.WebAssembly.DebugProxy</PackageId>
|
||||
<IsShipping>true</IsShipping>
|
||||
<IsPackable>true</IsPackable>
|
||||
<OutputType>exe</OutputType>
|
||||
<HasReferenceAssembly>false</HasReferenceAssembly>
|
||||
<AssemblyName>DebugProxy</AssemblyName>
|
||||
<PackageDescription>Debug proxy for use when building Blazor applications.</PackageDescription>
|
||||
<NuspecFile>Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.nuspec</NuspecFile>
|
||||
<!-- Set this to false because assemblies should not reference this assembly directly, (except for tests, of course). -->
|
||||
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
|
||||
<NoWarn>$(NoWarn);CS0649</NoWarn>
|
||||
<LangVersion>8</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -22,4 +23,13 @@
|
|||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<Target Name="GenerateDotnetTool" BeforeTargets="GenerateNuspec">
|
||||
<ItemGroup>
|
||||
<NuspecProperty Include="Path=..\..\artifacts\bin\Microsoft.AspNetCore.Components.WebAssembly.DebugProxy\$(Configuration)\$(TargetFramework)\" />
|
||||
</ItemGroup>
|
||||
|
||||
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Publish" Properties="TargetFramework=$(TargetFramework)" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -6,5 +6,9 @@
|
|||
<files>
|
||||
$CommonFileElements$
|
||||
<file src="..\..\THIRD-PARTY-NOTICES.txt" />
|
||||
<file src="$Path$*.dll" target="tools" />
|
||||
<file src="$Path$DebugProxy.dll" target="tools" />
|
||||
<file src="$Path$DebugProxy.runtimeconfig.json" target="tools" />
|
||||
<file src="$Path$DebugProxy.deps.json" target="tools" />
|
||||
</files>
|
||||
</package>
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Diagnostics;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using WebAssembly.Net.Debugging;
|
||||
|
@ -18,16 +16,17 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
|
|||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
app.UseWebSockets();
|
||||
app.UseRouting();
|
||||
|
||||
app.UseRouter(routes =>
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
// At the homepage, we check whether we can uniquely identify the target tab
|
||||
// - If yes, we redirect directly to the debug tools, proxying to that tab
|
||||
// - If no, we present a list of available tabs for the user to pick from
|
||||
routes.MapGet("/", new TargetPickerUi(debugProxyOptions).Display);
|
||||
endpoints.MapGet("/", new TargetPickerUi(debugProxyOptions).Display);
|
||||
|
||||
// At this URL, we wire up the actual WebAssembly proxy
|
||||
routes.MapGet("/ws-proxy", async (context) =>
|
||||
endpoints.MapGet("/ws-proxy", async (context) =>
|
||||
{
|
||||
if (!context.WebSockets.IsWebSocketRequest)
|
||||
{
|
||||
|
@ -42,10 +41,5 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddRouting();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче