.net - Generate assembly with Roslyn -


is possible build .net core or better .net standard library roslyn can referenced project?

my goal build assembly on server , have people download can reference , use in own visual studio projects.

i'm using roslyn generate c# code , compile it. seems work ok when "emit" compilation result memory stream, load assembly , execute code using reflection.

using (var ms = new memorystream()) {     var compilationresult = compilation.emit(ms);     if (compilationresult.success)     {     ms.position = 0;      var assembly = assemblyloadcontext.default.loadfromstream(ms); .. .. 

is can "save" assembly proving path emit method. results in .dll file on disk.

var compilationresult2 = compilation.emit(@"d:\testassembly.dll"); 

i wonder kind of format .dll file is. doesn't seem "normal" assembly.

i searched internet couldn't find doing this. misunderstand something?

so questions are:

  • what kind of format file create emit? full/normal assembly? i'm confused here because when open dotpeek shows:

enter image description here

i expect .net standard or .net core assembly. i'm not able use assembly referencing project in visual studio.

  • is possible generate assembly using roslyn can referenced separate .net core project?

thanks


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -