C#C
C#7mo ago
kazuhiro

✅ When I create a dll with PersistedAssemblyBuilder, there is a problem

Generate “NamespaceDynamic.dll” with “SimpleGenerateAssembly.
Reference “NamespaceDynamic.dll” in the “Reference” project.
Instantiate a class in “Reference. var a=new NamespaceDynamic.
Reference the field ValueTupleInt32 of type ValueTuple<int>. This is where the compile error occurs.
The error is
CS0201 The type 'ValueTuple<>' is defined in an unreferenced assembly. You need to add a reference to the assembly 'System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.

What we tried
1,When I look at “NamespaceDynamic.dll” in ILSpy, it refers to the System.Private.CoreLib
2,When I look at “NamespaceStatic.dll” in ILSpy, it refers to the System.Runtime


How can I use “NamespaceDynamic.dll” without problems?
PersistedAssemblyBuilder2.gif
image.png
Was this page helpful?