@@ -58,9 +58,13 @@ public void SameAsTemplate()
58
58
var dotnetProjectConvertProjectText = File . ReadAllText ( dotnetProjectConvertProject ) ;
59
59
var dotnetNewConsoleProjectText = File . ReadAllText ( dotnetNewConsoleProject ) ;
60
60
61
- // There are some differences: we add PublishAot=true and UserSecretsId.
61
+ // There are some differences: we add PublishAot=true, PackAsTool=true, and UserSecretsId.
62
62
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 ) ;
64
68
patchedDotnetProjectConvertProjectText = Regex . Replace ( patchedDotnetProjectConvertProjectText ,
65
69
""" <UserSecretsId>[^<]*<\/UserSecretsId>""" + Environment . NewLine , string . Empty ) ;
66
70
@@ -780,6 +784,7 @@ public void ProcessingSucceeds()
780
784
<ImplicitUsings>enable</ImplicitUsings>
781
785
<Nullable>enable</Nullable>
782
786
<PublishAot>true</PublishAot>
787
+ <PackAsTool>true</PackAsTool>
783
788
<UserSecretsId>Program-*</UserSecretsId>
784
789
</PropertyGroup>
785
790
@@ -827,6 +832,7 @@ public void UserSecretsId_Overridden_ViaDirective(bool hasDirectiveBuildProps)
827
832
<ImplicitUsings>enable</ImplicitUsings>
828
833
<Nullable>enable</Nullable>
829
834
<PublishAot>true</PublishAot>
835
+ <PackAsTool>true</PackAsTool>
830
836
<UserSecretsId>MyIdFromDirective</UserSecretsId>
831
837
</PropertyGroup>
832
838
@@ -866,6 +872,7 @@ public void UserSecretsId_Overridden_ViaDirectoryBuildProps()
866
872
<ImplicitUsings>enable</ImplicitUsings>
867
873
<Nullable>enable</Nullable>
868
874
<PublishAot>true</PublishAot>
875
+ <PackAsTool>true</PackAsTool>
869
876
</PropertyGroup>
870
877
871
878
</Project>
@@ -910,6 +917,7 @@ public void UserSecretsId_Overridden_SameAsImplicit(bool hasDirective, bool hasD
910
917
<ImplicitUsings>enable</ImplicitUsings>
911
918
<Nullable>enable</Nullable>
912
919
<PublishAot>true</PublishAot>
920
+ <PackAsTool>true</PackAsTool>
913
921
<UserSecretsId>{ ( hasDirective ? SecurityElement . Escape ( implicitValue ) : "Program-*" ) } </UserSecretsId>
914
922
</PropertyGroup>
915
923
@@ -941,6 +949,7 @@ public void Directives()
941
949
<ImplicitUsings>enable</ImplicitUsings>
942
950
<Nullable>enable</Nullable>
943
951
<PublishAot>true</PublishAot>
952
+ <PackAsTool>true</PackAsTool>
944
953
<TargetFramework>net472</TargetFramework>
945
954
<LangVersion>preview</LangVersion>
946
955
</PropertyGroup>
@@ -971,6 +980,7 @@ public void Directives_AllDefaultOverridden()
971
980
#:property TargetFramework=net472
972
981
#:property Nullable=disable
973
982
#:property PublishAot=false
983
+ #:property PackAsTool=false
974
984
#:property Custom=1
975
985
#:property ImplicitUsings=disable
976
986
Console.WriteLine();
@@ -983,6 +993,7 @@ public void Directives_AllDefaultOverridden()
983
993
<TargetFramework>net472</TargetFramework>
984
994
<Nullable>disable</Nullable>
985
995
<PublishAot>false</PublishAot>
996
+ <PackAsTool>false</PackAsTool>
986
997
<Custom>1</Custom>
987
998
<ImplicitUsings>disable</ImplicitUsings>
988
999
</PropertyGroup>
@@ -1012,6 +1023,7 @@ public void Directives_Variable()
1012
1023
<ImplicitUsings>enable</ImplicitUsings>
1013
1024
<Nullable>enable</Nullable>
1014
1025
<PublishAot>true</PublishAot>
1026
+ <PackAsTool>true</PackAsTool>
1015
1027
<MyProp>MyValue</MyProp>
1016
1028
</PropertyGroup>
1017
1029
@@ -1049,6 +1061,7 @@ public void Directives_DirectoryPath()
1049
1061
<ImplicitUsings>enable</ImplicitUsings>
1050
1062
<Nullable>enable</Nullable>
1051
1063
<PublishAot>true</PublishAot>
1064
+ <PackAsTool>true</PackAsTool>
1052
1065
</PropertyGroup>
1053
1066
1054
1067
<ItemGroup>
@@ -1087,6 +1100,7 @@ public void Directives_Separators()
1087
1100
<ImplicitUsings>enable</ImplicitUsings>
1088
1101
<Nullable>enable</Nullable>
1089
1102
<PublishAot>true</PublishAot>
1103
+ <PackAsTool>true</PackAsTool>
1090
1104
<Prop1>One=a/b</Prop1>
1091
1105
<Prop2>Two/a=b</Prop2>
1092
1106
</PropertyGroup>
@@ -1196,6 +1210,7 @@ public void Directives_Escaping()
1196
1210
<ImplicitUsings>enable</ImplicitUsings>
1197
1211
<Nullable>enable</Nullable>
1198
1212
<PublishAot>true</PublishAot>
1213
+ <PackAsTool>true</PackAsTool>
1199
1214
<Prop><test"></Prop>
1200
1215
</PropertyGroup>
1201
1216
@@ -1230,6 +1245,7 @@ public void Directives_Whitespace()
1230
1245
<ImplicitUsings>enable</ImplicitUsings>
1231
1246
<Nullable>enable</Nullable>
1232
1247
<PublishAot>true</PublishAot>
1248
+ <PackAsTool>true</PackAsTool>
1233
1249
<Name>Value</Name>
1234
1250
<NugetPackageDescription>"My package with spaces"</NugetPackageDescription>
1235
1251
</PropertyGroup>
@@ -1256,6 +1272,7 @@ public void Directives_BlankLines()
1256
1272
<ImplicitUsings>enable</ImplicitUsings>
1257
1273
<Nullable>enable</Nullable>
1258
1274
<PublishAot>true</PublishAot>
1275
+ <PackAsTool>true</PackAsTool>
1259
1276
</PropertyGroup>
1260
1277
1261
1278
<ItemGroup>
@@ -1321,6 +1338,7 @@ public void Directives_AfterToken()
1321
1338
<ImplicitUsings>enable</ImplicitUsings>
1322
1339
<Nullable>enable</Nullable>
1323
1340
<PublishAot>true</PublishAot>
1341
+ <PackAsTool>true</PackAsTool>
1324
1342
<Prop1>1</Prop1>
1325
1343
<Prop2>2</Prop2>
1326
1344
</PropertyGroup>
@@ -1367,6 +1385,7 @@ public void Directives_AfterIf()
1367
1385
<ImplicitUsings>enable</ImplicitUsings>
1368
1386
<Nullable>enable</Nullable>
1369
1387
<PublishAot>true</PublishAot>
1388
+ <PackAsTool>true</PackAsTool>
1370
1389
<Prop1>1</Prop1>
1371
1390
<Prop2>2</Prop2>
1372
1391
</PropertyGroup>
@@ -1410,6 +1429,7 @@ public void Directives_Comments()
1410
1429
<ImplicitUsings>enable</ImplicitUsings>
1411
1430
<Nullable>enable</Nullable>
1412
1431
<PublishAot>true</PublishAot>
1432
+ <PackAsTool>true</PackAsTool>
1413
1433
<Prop1>1</Prop1>
1414
1434
<Prop2>2</Prop2>
1415
1435
</PropertyGroup>
@@ -1517,6 +1537,7 @@ public void Directives_VersionedSdkFirst()
1517
1537
<ImplicitUsings>enable</ImplicitUsings>
1518
1538
<Nullable>enable</Nullable>
1519
1539
<PublishAot>true</PublishAot>
1540
+ <PackAsTool>true</PackAsTool>
1520
1541
</PropertyGroup>
1521
1542
1522
1543
</Project>
0 commit comments