You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Microsoft.NET.Build.Containers/build/Microsoft.NET.Build.Containers.targets
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,18 @@
1
1
<Project>
2
+
<TargetName="_ContainerVerifySDKVersion"
3
+
Condition="'$(WebPublishMethod)' == 'Container' or '$(PublishProfile)' == 'DefaultContainer'"
4
+
BeforeTargets="AfterPublish">
5
+
<!-- If the user has opted into container publishing via their own profile (WebPublishMethod = Container) or
6
+
via the default Profile (PublishProfile = DefaultContainer), make sure they're on a supported SDK version.
7
+
We do the explicit profile name check here because for preview6 for example the profile didn't exist, so we
8
+
can't rely only on the WebPublishMethod. -->
9
+
<PropertyGroup>
10
+
<!-- Allow preview 7, any RC, or any stable version of 7 -->
11
+
<_IsAllowedVersionCondition="$(NETCoreSdkVersion.StartsWith('7.0.100-preview.7')) or $(NETCoreSdkVersion.StartsWith('7.0.100-rc')) or ($(NETCoreSdkVersion.StartsWith('7.0.10')) and $(NETCoreSdkVersion.Contains('-')) == false)">true</_IsAllowedVersion>
12
+
</PropertyGroup>
13
+
<ErrorCondition="'$(_IsAllowedVersion)' != 'true'"Code="CONTAINER002"Text="The current .NET SDK ($(NETCoreSdkVersion)) doesn't support containerization. Please use version 7.0.100-preview.7 or higher." />
0 commit comments