When I generate a dll in Roslyn referencing System.Private.CoreLib.dll it correctly errors when I try to reference it in a .NET Framework application. However when I inspect the dll using ILSpy the metadata information (below) is missing and ILSpy just defaults .NetFramework, v4.0
.
[assembly: TargetFramework(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")]
The dll has been created correctly but the process seems to not specify the assembly metadata. Is there anyway to set this metadata when creating the dll using Roslyn? It also neglects to set things like AssemblyFileVersion
, AssemblyTitle
etc.
Edit
Found the answer here