@@ -127,21 +127,14 @@ internal void Create(TestAsset targetTestAsset, string testProjectsSourceFolder)
127
127
// If there are any targets that aren't .NET Framework, add appropriate package reference
128
128
if ( targetFrameworks . Any ( identifier => ! GetShortTargetFrameworkIdentifier ( identifier ) . Equals ( "net" , StringComparison . OrdinalIgnoreCase ) ) )
129
129
{
130
- XElement packageReference ;
130
+ XElement packageReference = null ;
131
131
if ( this . IsExe )
132
132
{
133
133
packageReference = new XElement ( ns + "PackageReference" ,
134
134
new XAttribute ( "Include" , "Microsoft.NETCore.App" ) ,
135
135
new XAttribute ( "Version" , "1.0.1" )
136
136
) ;
137
137
}
138
- else
139
- {
140
- packageReference = new XElement ( ns + "PackageReference" ,
141
- new XAttribute ( "Include" , "NETStandard.Library" ) ,
142
- new XAttribute ( "Version" , "1.6.0" )
143
- ) ;
144
- }
145
138
146
139
if ( targetFrameworks . Any ( identifier => GetShortTargetFrameworkIdentifier ( identifier ) . Equals ( "net" , StringComparison . OrdinalIgnoreCase ) ) )
147
140
{
@@ -164,10 +157,13 @@ internal void Create(TestAsset targetTestAsset, string testProjectsSourceFolder)
164
157
}
165
158
}
166
159
167
- packageReference . SetAttributeValue ( "Condition" , condition ) ;
160
+ packageReference ? . SetAttributeValue ( "Condition" , condition ) ;
168
161
}
169
162
170
- packageReferenceItemGroup . Add ( packageReference ) ;
163
+ if ( packageReference != null )
164
+ {
165
+ packageReferenceItemGroup . Add ( packageReference ) ;
166
+ }
171
167
}
172
168
173
169
if ( this . IsExe && targetFrameworks . Any ( identifier => GetShortTargetFrameworkIdentifier ( identifier ) . Equals ( "net" , StringComparison . OrdinalIgnoreCase ) ) )
0 commit comments