Skip to content

Commit b0530a6

Browse files
authored
Do not include the shared framework in the packages (#24816)
* Do not include the shared framework in the packages DevServer and dotnet-watch include binaries from the ASP.NET Core shared framework as part of the package. This change compiles these projects against the most recently built version of the shared framework which ensures build and publish work as normals. Individual projects from the runtime can be referenced to pick up new runtime features when necessary * More hacks! * Ensure shared runtime is built before running tests * Delete dotnet-watch.nuspec
1 parent 70ea49f commit b0530a6

File tree

7 files changed

+53
-40
lines changed

7 files changed

+53
-40
lines changed

src/Components/WebAssembly/DevServer/src/Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,26 @@
1111
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1212
<!-- Set this to false because assemblies should not reference this assembly directly, (except for tests, of course). -->
1313
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
14+
15+
<!--
16+
This project compiles against Microsoft.AspNetCore.App from the SDK.
17+
This ensures that it's packaging output is correct and does not include local artifacts.
18+
-->
19+
<UseAspNetCoreSharedRuntime>true</UseAspNetCoreSharedRuntime>
20+
<DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>true</DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>
1421
</PropertyGroup>
1522

1623
<ItemGroup>
17-
<Reference Include="Microsoft.AspNetCore" />
18-
<Reference Include="Microsoft.AspNetCore.Diagnostics" />
19-
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
20-
<Reference Include="Microsoft.AspNetCore.Components.Server" />
21-
<Reference Include="Microsoft.AspNetCore.ResponseCompression" />
24+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
2225

26+
<ProjectReference
27+
Include="$(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj"
28+
PrivateAssets="All"
29+
ReferenceOutputAssembly="false"
30+
SkipGetTargetFrameworkProperties="true" />
31+
32+
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
2333
<Compile Include="$(SharedSourceRoot)CommandLineUtils\**\*.cs" />
24-
<Reference Include="Microsoft.Extensions.Hosting" />
2534
</ItemGroup>
2635

2736
<!-- Pack settings -->
@@ -36,19 +45,5 @@
3645
<NuspecProperty Include="PackageThirdPartyNoticesFile=$(PackageThirdPartyNoticesFile)" />
3746
</ItemGroup>
3847

39-
<Target Name="_FixupRuntimeConfig" BeforeTargets="_GenerateRuntimeConfigurationFilesInputCache">
40-
<ItemGroup>
41-
<_RuntimeFramework Include="@(RuntimeFramework)" />
42-
<RuntimeFramework Remove="@(RuntimeFramework)" />
43-
<RuntimeFramework Include="Microsoft.AspNetCore.App" FrameworkName="Microsoft.AspNetCore.App" Version="5.0.0-preview" />
44-
</ItemGroup>
45-
</Target>
46-
47-
<Target Name="_UndoRuntimeConfigWorkarounds" AfterTargets="GenerateBuildRuntimeConfigurationFiles">
48-
<ItemGroup>
49-
<RuntimeFramework Remove="@(RuntimeFramework)" />
50-
<RuntimeFramework Include="@(_RuntimeFramework)" />
51-
</ItemGroup>
52-
</Target>
5348

5449
</Project>

src/Components/benchmarkapps/Wasm.Performance/Driver/Wasm.Performance.Driver.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15+
<Reference Include="Microsoft.AspNetCore" />
1516
<Reference Include="Microsoft.AspNetCore.Cors" />
17+
<Reference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
1618
<Reference Include="Selenium.Support" />
1719
<Reference Include="Selenium.WebDriver" />
18-
<ProjectReference Include="..\..\..\WebAssembly\DevServer\src\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj" />
1920
<ProjectReference Include="..\TestApp\Wasm.Performance.TestApp.csproj" />
2021
</ItemGroup>
2122

23+
<ItemGroup>
24+
<Compile Include="..\..\..\WebAssembly\DevServer\src\Server\*.cs" />
25+
</ItemGroup>
26+
2227
<Target Name="_AddTestProjectMetadataAttributes" BeforeTargets="BeforeCompile">
2328
<ItemGroup>
2429
<AssemblyAttribute

src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
<ProjectReference Include="..\..\WebAssembly\testassets\HostedInAspNet.Client\HostedInAspNet.Client.csproj" />
4242
<ProjectReference Include="..\..\WebAssembly\testassets\HostedInAspNet.Server\HostedInAspNet.Server.csproj" />
4343
<ProjectReference Include="..\..\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj" />
44-
<ProjectReference Include="..\..\WebAssembly\DevServer\src\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj" />
4544
<ProjectReference Include="..\testassets\BasicTestApp\BasicTestApp.csproj" />
4645
<ProjectReference Include="..\testassets\TestServer\Components.TestServer.csproj" />
4746
<ProjectReference Include="..\..\WebAssembly\testassets\Wasm.Authentication.Server\Wasm.Authentication.Server.csproj" />

src/Components/test/testassets/TestServer/Components.TestServer.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<ProjectReference Include="..\..\..\WebAssembly\DevServer\src\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj" />
2625
<ProjectReference Include="..\BasicTestApp\BasicTestApp.csproj" />
2726
</ItemGroup>
2827

28+
<ItemGroup>
29+
<Compile Include="..\..\..\WebAssembly\DevServer\src\Server\*.cs" />
30+
</ItemGroup>
31+
2932
<ItemGroup>
3033
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
3134
<_Parameter1>Microsoft.AspNetCore.Testing.BasicTestApp.ContentRoot</_Parameter1>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<DotNetCliTool Version="1">
3+
<Commands>
4+
<Command Name="dotnet-watch" EntryPoint="dotnet-watch.dll" Runner="dotnet" />
5+
</Commands>
6+
</DotNetCliTool>

src/Tools/dotnet-watch/src/dotnet-watch.csproj

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
<!-- This package is for internal use only. It contains a CLI which is bundled in the .NET Core SDK. -->
1111
<IsShippingPackage>false</IsShippingPackage>
1212
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
13+
14+
<!--
15+
This project compiles against Microsoft.AspNetCore.App from the SDK.
16+
This ensures that it's packaging output is correct and does not include local artifacts.
17+
-->
18+
<UseAspNetCoreSharedRuntime>true</UseAspNetCoreSharedRuntime>
19+
<DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>true</DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>
1320
</PropertyGroup>
1421

1522
<ItemGroup>
@@ -20,8 +27,13 @@
2027
</ItemGroup>
2128

2229
<ItemGroup>
23-
<Reference Include="Microsoft.AspNetCore" />
24-
<Reference Include="Microsoft.AspNetCore.WebSockets" />
30+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
31+
32+
<ProjectReference
33+
Include="$(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj"
34+
PrivateAssets="All"
35+
ReferenceOutputAssembly="false"
36+
SkipGetTargetFrameworkProperties="true" />
2537

2638
<Reference
2739
Include="Microsoft.AspNetCore.Watch.BrowserRefresh"
@@ -53,19 +65,4 @@
5365
</ItemGroup>
5466
</Target>
5567

56-
<Target Name="_FixupRuntimeConfig" BeforeTargets="_GenerateRuntimeConfigurationFilesInputCache">
57-
<ItemGroup>
58-
<_RuntimeFramework Include="@(RuntimeFramework)" />
59-
<RuntimeFramework Remove="@(RuntimeFramework)" />
60-
<RuntimeFramework Include="Microsoft.AspNetCore.App" FrameworkName="Microsoft.AspNetCore.App" Version="5.0.0-preview" />
61-
</ItemGroup>
62-
</Target>
63-
64-
<Target Name="_UndoRuntimeConfigWorkarounds" AfterTargets="GenerateBuildRuntimeConfigurationFiles">
65-
<ItemGroup>
66-
<RuntimeFramework Remove="@(RuntimeFramework)" />
67-
<RuntimeFramework Include="@(_RuntimeFramework)" />
68-
</ItemGroup>
69-
</Target>
70-
7168
</Project>

src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
<AssemblyName>Microsoft.DotNet.Watcher.Tools.Tests</AssemblyName>
66
<DefaultItemExcludes>$(DefaultItemExcludes);TestProjects\**\*</DefaultItemExcludes>
77
<TestGroupName>DotNetWatcherToolsTests</TestGroupName>
8+
9+
<!--
10+
This project compiles against Microsoft.AspNetCore.App from the SDK.
11+
This ensures that it's packaging output is correct and does not include local artifacts.
12+
-->
13+
<UseAspNetCoreSharedRuntime>true</UseAspNetCoreSharedRuntime>
14+
<DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>true</DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>
815
</PropertyGroup>
916

1017
<ItemGroup>
@@ -14,6 +21,7 @@
1421

1522
<ItemGroup>
1623
<ProjectReference Include="..\src\dotnet-watch.csproj" />
24+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
1725
</ItemGroup>
1826

1927
<ItemGroup>

0 commit comments

Comments
 (0)