0

Hey guys!

Hope you all doing well :)

I have the following error in my assemblies:

'System.CodeDom.Compiler.CodeDomProvider.CreateCompiler()' is obsolete: '"Callers should not use the ICodeCompiler interface and should instead use the methods directly on the CodeDomProvider class. Those inheriting from CodeDomProvider must still implement this interface, and should exclude this warning or also obsolete this method."'

and my code is the following:

static ICodeCompiler CreateCompiler()
{

using (CodeDomProvider codeProvider = new CSharpCodeProvider())
{
ICodeCompiler compiler = codeProvider.CreateCompiler();
return compiler;
}
}

What would be the correct way then to write the code and NOT get the warning. And if anyone could also just explain a bit as to why the CreateCompiler() is obsolote - just for some background and knowledge

Fanx guys

Go well and happy coding :)

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by geoNeo_
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.