Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I have some C# code that dynamically generates source code from SOAP WSDLs and Swagger documents, and then compiles it using the CSharpCodeProvider class's method called CompileAssemblyFromSource. Using .Net 4.8 this works fine, but in trying to port to .Net Core 3.0, I now get this error:
"Operation is not supported on this platform."
Is there support for this functionality in .Net Core, or is it likely to be added soon? Here's a simplified code extract:
CSharpCodeProvider codeProvider = new CSharpCodeProvider();
string[] m_References = new string[] { "System.dll", "System.Core.dll", "System.Data.dll", "System.Net.dll", "System.Net.Http.dll", "System.Runtime.Serialization.dll", "System.ServiceModel.dll", "System.Xml.dll" };
CompilerParameters compilerParameters = CreateCompilerParameters(m_References);
m_CompilerResults = codeProvider.CompileAssemblyFromSource(compilerParameters, m_SourceStringArray);
if (!m_CompilerResults.Errors.HasErrors)
/* render UI using compiled code */
/* log compiler errors */
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.