Skip to content

Commit

Permalink
Warn if runtimeconfig.template.json is used with PublishAot (dotnet#7…
Browse files Browse the repository at this point in the history
…3996)

* Warn if runtimeconfig.template.json is used with PublishAot

Fixes dotnet#72310.
  • Loading branch information
MichalStrehovsky authored Aug 16, 2022
1 parent 8e60555 commit adc2b68
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
<UsingTask TaskName="ComputeManagedAssembliesToCompileToNative" AssemblyFile="$(IlcBuildTasksPath)" />
<Target Name="_ComputeAssembliesToCompileToNative" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)">

<Warning Condition="Exists($(UserRuntimeConfig))" Text="The published project has a runtimeconfig.template.json that is not supported by PublishAot. Move the configuration to the project file using RuntimeHostConfigurationOption." />

<!-- Fail with descriptive error message for common mistake. -->
<Error Condition="$([MSBuild]::VersionLessThan('$(NETCoreSdkVersion)', '6.0.0'))" Text=".NET SDK 6+ is required for native compilation." />
<Error Condition="$([MSBuild]::VersionLessThan('$(TargetFrameworkVersion)', '6.0'))" Text="For native compilation, the project needs to target .NET 6 or higher." />
Expand Down

0 comments on commit adc2b68

Please sign in to comment.