C
C#2y ago
Scarlet

Is there is an easy way to compile and run C# through roslyn without injecting .NET Core library?

.
12 Replies
Jimmacle
Jimmacle2y ago
What do you mean by injecting
Scarlet
ScarletOP2y ago
When you compile C# through dotnet it will contain the .net core lib by default I just want to avoid this, in a not very-much-complicated way for educational purposes
Jimmacle
Jimmacle2y ago
You somehow have code that doesn't use any core .net types?
Scarlet
ScarletOP2y ago
That's what I want to do
Jimmacle
Jimmacle2y ago
But do you actually have code like that
Scarlet
ScarletOP2y ago
An empty class works no?
Jimmacle
Jimmacle2y ago
But it doesn't do anything useful
Scarlet
ScarletOP2y ago
or does it derivate from Object
Jimmacle
Jimmacle2y ago
And that
Scarlet
ScarletOP2y ago
Yes that's for curiosity purpose only
333fred
333fred2y ago
This is basically the one and only time I would say you'd need to use csc directly But, also, you'll need to do things like define object And you won't really be able to run it anywhere So, "easy" is relative
Scarlet
ScarletOP2y ago
Gotcha, Ill do some experiments

Did you find this page helpful?