Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim down framework references for Blazor dev server #31420

Merged
merged 3 commits into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a SharedFxVersion variable that's configured at the repo level. (I think). You should use that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://github.com/dotnet/aspnetcore/blob/main/Directory.Build.targets#L47-L48. The variable is defined in every project that imports the Directory.Build.targets file. Note some projects are isolated i.e. don't import that file, some are test assets we want to be as realistic / normal as possible while other projects simply aren't .NET SDK projects.

</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>
captainsafia marked this conversation as resolved.
Show resolved Hide resolved
</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.