© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•9mo ago•
7 replies
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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

PersistedAssemblyBuilder to generate executable
C#CC# / help
14mo ago
❔ Problem with including C DLL in a C# console app project.
C#CC# / help
3y ago
Packing an external DLL with my own DLL
C#CC# / help
2y ago
✅ is there a way to delete or overwrite a dll during the postbuild event?
C#CC# / help
3y ago