@@ -58,9 +58,13 @@ public void SameAsTemplate()
5858 var dotnetProjectConvertProjectText = File . ReadAllText ( dotnetProjectConvertProject ) ;
5959 var dotnetNewConsoleProjectText = File . ReadAllText ( dotnetNewConsoleProject ) ;
6060
61- // There are some differences: we add PublishAot=true and UserSecretsId.
61+ // There are some differences: we add PublishAot=true, PackAsTool=true, and UserSecretsId.
6262 var patchedDotnetProjectConvertProjectText = dotnetProjectConvertProjectText
63- . Replace ( " <PublishAot>true</PublishAot>" + Environment . NewLine , string . Empty ) ;
63+ . Replace ( """
64+ <PublishAot>true</PublishAot>
65+ <PackAsTool>true</PackAsTool>
66+
67+ """ , string . Empty ) ;
6468 patchedDotnetProjectConvertProjectText = Regex . Replace ( patchedDotnetProjectConvertProjectText ,
6569 """ <UserSecretsId>[^<]*<\/UserSecretsId>""" + Environment . NewLine , string . Empty ) ;
6670
@@ -780,6 +784,7 @@ public void ProcessingSucceeds()
780784 <ImplicitUsings>enable</ImplicitUsings>
781785 <Nullable>enable</Nullable>
782786 <PublishAot>true</PublishAot>
787+ <PackAsTool>true</PackAsTool>
783788 <UserSecretsId>Program-*</UserSecretsId>
784789 </PropertyGroup>
785790
@@ -827,6 +832,7 @@ public void UserSecretsId_Overridden_ViaDirective(bool hasDirectiveBuildProps)
827832 <ImplicitUsings>enable</ImplicitUsings>
828833 <Nullable>enable</Nullable>
829834 <PublishAot>true</PublishAot>
835+ <PackAsTool>true</PackAsTool>
830836 <UserSecretsId>MyIdFromDirective</UserSecretsId>
831837 </PropertyGroup>
832838
@@ -866,6 +872,7 @@ public void UserSecretsId_Overridden_ViaDirectoryBuildProps()
866872 <ImplicitUsings>enable</ImplicitUsings>
867873 <Nullable>enable</Nullable>
868874 <PublishAot>true</PublishAot>
875+ <PackAsTool>true</PackAsTool>
869876 </PropertyGroup>
870877
871878 </Project>
@@ -910,6 +917,7 @@ public void UserSecretsId_Overridden_SameAsImplicit(bool hasDirective, bool hasD
910917 <ImplicitUsings>enable</ImplicitUsings>
911918 <Nullable>enable</Nullable>
912919 <PublishAot>true</PublishAot>
920+ <PackAsTool>true</PackAsTool>
913921 <UserSecretsId>{ ( hasDirective ? SecurityElement . Escape ( implicitValue ) : "Program-*" ) } </UserSecretsId>
914922 </PropertyGroup>
915923
@@ -941,6 +949,7 @@ public void Directives()
941949 <ImplicitUsings>enable</ImplicitUsings>
942950 <Nullable>enable</Nullable>
943951 <PublishAot>true</PublishAot>
952+ <PackAsTool>true</PackAsTool>
944953 <TargetFramework>net472</TargetFramework>
945954 <LangVersion>preview</LangVersion>
946955 </PropertyGroup>
@@ -971,6 +980,7 @@ public void Directives_AllDefaultOverridden()
971980 #:property TargetFramework=net472
972981 #:property Nullable=disable
973982 #:property PublishAot=false
983+ #:property PackAsTool=false
974984 #:property Custom=1
975985 #:property ImplicitUsings=disable
976986 Console.WriteLine();
@@ -983,6 +993,7 @@ public void Directives_AllDefaultOverridden()
983993 <TargetFramework>net472</TargetFramework>
984994 <Nullable>disable</Nullable>
985995 <PublishAot>false</PublishAot>
996+ <PackAsTool>false</PackAsTool>
986997 <Custom>1</Custom>
987998 <ImplicitUsings>disable</ImplicitUsings>
988999 </PropertyGroup>
@@ -1012,6 +1023,7 @@ public void Directives_Variable()
10121023 <ImplicitUsings>enable</ImplicitUsings>
10131024 <Nullable>enable</Nullable>
10141025 <PublishAot>true</PublishAot>
1026+ <PackAsTool>true</PackAsTool>
10151027 <MyProp>MyValue</MyProp>
10161028 </PropertyGroup>
10171029
@@ -1049,6 +1061,7 @@ public void Directives_DirectoryPath()
10491061 <ImplicitUsings>enable</ImplicitUsings>
10501062 <Nullable>enable</Nullable>
10511063 <PublishAot>true</PublishAot>
1064+ <PackAsTool>true</PackAsTool>
10521065 </PropertyGroup>
10531066
10541067 <ItemGroup>
@@ -1087,6 +1100,7 @@ public void Directives_Separators()
10871100 <ImplicitUsings>enable</ImplicitUsings>
10881101 <Nullable>enable</Nullable>
10891102 <PublishAot>true</PublishAot>
1103+ <PackAsTool>true</PackAsTool>
10901104 <Prop1>One=a/b</Prop1>
10911105 <Prop2>Two/a=b</Prop2>
10921106 </PropertyGroup>
@@ -1196,6 +1210,7 @@ public void Directives_Escaping()
11961210 <ImplicitUsings>enable</ImplicitUsings>
11971211 <Nullable>enable</Nullable>
11981212 <PublishAot>true</PublishAot>
1213+ <PackAsTool>true</PackAsTool>
11991214 <Prop><test"></Prop>
12001215 </PropertyGroup>
12011216
@@ -1230,6 +1245,7 @@ public void Directives_Whitespace()
12301245 <ImplicitUsings>enable</ImplicitUsings>
12311246 <Nullable>enable</Nullable>
12321247 <PublishAot>true</PublishAot>
1248+ <PackAsTool>true</PackAsTool>
12331249 <Name>Value</Name>
12341250 <NugetPackageDescription>"My package with spaces"</NugetPackageDescription>
12351251 </PropertyGroup>
@@ -1256,6 +1272,7 @@ public void Directives_BlankLines()
12561272 <ImplicitUsings>enable</ImplicitUsings>
12571273 <Nullable>enable</Nullable>
12581274 <PublishAot>true</PublishAot>
1275+ <PackAsTool>true</PackAsTool>
12591276 </PropertyGroup>
12601277
12611278 <ItemGroup>
@@ -1321,6 +1338,7 @@ public void Directives_AfterToken()
13211338 <ImplicitUsings>enable</ImplicitUsings>
13221339 <Nullable>enable</Nullable>
13231340 <PublishAot>true</PublishAot>
1341+ <PackAsTool>true</PackAsTool>
13241342 <Prop1>1</Prop1>
13251343 <Prop2>2</Prop2>
13261344 </PropertyGroup>
@@ -1367,6 +1385,7 @@ public void Directives_AfterIf()
13671385 <ImplicitUsings>enable</ImplicitUsings>
13681386 <Nullable>enable</Nullable>
13691387 <PublishAot>true</PublishAot>
1388+ <PackAsTool>true</PackAsTool>
13701389 <Prop1>1</Prop1>
13711390 <Prop2>2</Prop2>
13721391 </PropertyGroup>
@@ -1410,6 +1429,7 @@ public void Directives_Comments()
14101429 <ImplicitUsings>enable</ImplicitUsings>
14111430 <Nullable>enable</Nullable>
14121431 <PublishAot>true</PublishAot>
1432+ <PackAsTool>true</PackAsTool>
14131433 <Prop1>1</Prop1>
14141434 <Prop2>2</Prop2>
14151435 </PropertyGroup>
@@ -1517,6 +1537,7 @@ public void Directives_VersionedSdkFirst()
15171537 <ImplicitUsings>enable</ImplicitUsings>
15181538 <Nullable>enable</Nullable>
15191539 <PublishAot>true</PublishAot>
1540+ <PackAsTool>true</PackAsTool>
15201541 </PropertyGroup>
15211542
15221543 </Project>
0 commit comments