0

im using codedom library to compile some codes in string format. i have to use this library in a .net core project. first i made a project with .net framework(because codedom works with .net framework) , and every thing worked fine. but when i refrenced my .net core project to the first project i faced with "Operation is not supported" in first project. CompilerResults compileResult = codeCompiler.CompileAssemblyFromSource(compileParams, code);

what should i do to fix this? thanks for your time.

2
  • 1
    The fix is simply to not use CodeDOM. It's not supported on Core (up to and including .NET 6). The alternative is to use Roslyn to compile code, or a library dedicated to parsing specific expression formats rather than arbitrary C# (which is dangerous to begin with). Commented Mar 14, 2022 at 8:23
  • Take a look into nuget.org/packages/Microsoft.CodeAnalysis.CSharp.Scripting Commented Mar 14, 2022 at 8:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.