Skip to content

Can I generate .NET Core assembly with a Roslyn running under .NET Framework #48273

Discussion options

You must be logged in to vote

Not sure if this problem is still relevant to you, but I randomly remembered seeing this question and forgetting to answer it.

I believe the only meaningful* difference between a .NET Core assembly and a .NET Framework assembly is which BCL assemblies they reference. As such there's nothing preventing Roslyn running under .NET Framework from generating .NET Core assemblies. (Visual Studio runs Roslyn under .NET Framework, at least in some scenarios.)

If you just want tools like ILSpy to identify your assembly as .NET Core, you need to add TargetFrameworkAttribute to your code. (This is normally done automatically by MSBuild.)

In the case of executables .NET Framework is somewhat different…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@PathogenDavid
Comment options

Comment options

You must be logged in to vote
2 replies
@yevgeni-zolotko
Comment options

@PathogenDavid
Comment options

Answer selected by yevgeni-zolotko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #48273 on October 05, 2020 16:05.