@@ -199,9 +199,7 @@ private static int ProcessOutputs(Options options, string folder, CompilationCon
199
199
{
200
200
// Try to compile the artifacts into a dll
201
201
202
- string coreDir = Path . GetDirectoryName ( typeof ( object ) . Assembly . Location ) ! ;
203
-
204
- var syntaxTree = CSharpSyntaxTree . ParseText ( artifact ) ;
202
+ var coreDir = Path . GetDirectoryName ( typeof ( object ) . Assembly . Location ) ! ;
205
203
var references = new MetadataReference [ ]
206
204
{
207
205
MetadataReference . CreateFromFile ( Path . Combine ( coreDir , "System.Runtime.dll" ) ) ,
@@ -210,16 +208,18 @@ private static int ProcessOutputs(Options options, string folder, CompilationCon
210
208
MetadataReference . CreateFromFile ( typeof ( DisplayNameAttribute ) . Assembly . Location ) ,
211
209
MetadataReference . CreateFromFile ( typeof ( System . Numerics . BigInteger ) . Assembly . Location ) ,
212
210
MetadataReference . CreateFromFile ( typeof ( NeoSystem ) . Assembly . Location ) ,
213
- MetadataReference . CreateFromFile ( typeof ( SmartContract . Testing . SmartContract ) . Assembly . Location )
211
+ MetadataReference . CreateFromFile ( typeof ( SmartContract . Testing . TestEngine ) . Assembly . Location )
214
212
} ;
215
213
216
- var compilation = CSharpCompilation . Create ( baseName , new [ ] { syntaxTree } , references ,
217
- new CSharpCompilationOptions (
214
+ CSharpCompilationOptions csOptions = new (
218
215
OutputKind . DynamicallyLinkedLibrary ,
219
216
optimizationLevel : OptimizationLevel . Release ,
220
217
platform : Platform . AnyCpu ,
221
- deterministic : true
222
- ) ) ;
218
+ nullableContextOptions : NullableContextOptions . Enable ,
219
+ deterministic : true ) ;
220
+
221
+ var syntaxTree = CSharpSyntaxTree . ParseText ( artifact , options : CSharpParseOptions . Default . WithLanguageVersion ( LanguageVersion . Latest ) ) ;
222
+ var compilation = CSharpCompilation . Create ( baseName , new [ ] { syntaxTree } , references , csOptions ) ;
223
223
224
224
using var ms = new MemoryStream ( ) ;
225
225
EmitResult result = compilation . Emit ( ms ) ;
0 commit comments