Skip to content

Commit

Permalink
Trim down framework references for Blazor dev server (#31420)
Browse files Browse the repository at this point in the history
* Only include Microsoft.AspNetCore.App framework reference for Blazor dev server
* Address feedback from peer review
* Use SharedFxVersion property
  • Loading branch information
captainsafia authored Apr 1, 2021
1 parent fb0b099 commit 5ec8418
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@
<XunitExtensibilityExecutionVersion>$(XunitVersion)</XunitExtensibilityExecutionVersion>
<XUnitRunnerVisualStudioVersion>2.4.3</XUnitRunnerVisualStudioVersion>
<MicrosoftDataSqlClientVersion>1.0.19249.1</MicrosoftDataSqlClientVersion>
<MicrosoftAspNetCoreAppVersion>6.0.0-preview.3.21167.1</MicrosoftAspNetCoreAppVersion>
</PropertyGroup>
<!-- Restore feeds -->
<PropertyGroup Label="Restore feeds">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Set this to false because assemblies should not reference this assembly directly, (except for tests, of course). -->
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
<!-- Disable the default runtimeconfig.json in favor of the one that we create which contains the correct
framework references. Workaround for issues launching Blazor WASM apps with IIS Express. -->
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
</PropertyGroup>

<ItemGroup>
Expand All @@ -19,6 +22,21 @@
<Compile Include="$(SharedSourceRoot)CommandLineUtils\**\*.cs" />
</ItemGroup>

<Target Name="_CreateRuntimeConfig" BeforeTargets="CoreBuild">
<PropertyGroup>
<_RuntimeConfigProperties>
SharedFxVersion=$(SharedFxVersion);
</_RuntimeConfigProperties>

<_RuntimeConfigPath>$(IntermediateOutputPath)blazor-devserver.runtimeconfig.json</_RuntimeConfigPath>
</PropertyGroup>

<GenerateFileFromTemplate
TemplateFile="blazor-devserver.runtimeconfig.json.in"
Properties="$(_RuntimeConfigProperties)"
OutputPath="$(_RuntimeConfigPath)" />
</Target>

<!-- Pack settings -->
<PropertyGroup>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);publish</GenerateNuspecDependsOn>
Expand All @@ -28,6 +46,7 @@

<ItemGroup>
<NuspecProperty Include="publishDir=$(PublishDir)" />
<NuspecProperty Include="objDir=$(IntermediateOutputPath)" />
<NuspecProperty Include="PackageThirdPartyNoticesFile=$(PackageThirdPartyNoticesFile)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
<file src="build\**" target="build" />
<file src="$publishDir$**\*" target="tools" />
<file src="$PackageThirdPartyNoticesFile$" target=".\THIRD-PARTY-NOTICES.txt" />
<file src="$objDir$blazor-devserver.runtimeconfig.json" target="tools\blazor-devserver.runtimeconfig.json" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.AspNetCore.App",
"version": "${SharedFxVersion}"
},
"rollForwardOnNoCandidateFx": 2
}
}

This file was deleted.

0 comments on commit 5ec8418

Please sign in to comment.