mcs-ICodeCompiler icon indicating copy to clipboard operation
mcs-ICodeCompiler copied to clipboard

Building On Unity 2017

Open YoungXiang opened this issue 8 years ago • 8 comments

Assets/CSharpCompiler/CodeCompiler.cs(17,33): error CS0246: The type or namespace name `ICodeCompiler' could not be found. Are you missing an assembly reference?

The same for CompilerResults and CompilerParameters, both cannot be found.

YoungXiang avatar Nov 07 '17 08:11 YoungXiang

It seems the Unity 2017 changed it's .NET classes, they removed ICodeCompiler and all related classes.

JakubNei avatar Jan 06 '18 12:01 JakubNei

Sorry to ask the dumb unresearched question but... can this be worked-around? Perhaps by adding missing class(es) to a/the separate DLL?

Arakade avatar Jan 07 '18 10:01 Arakade

Yes yes, I'm working on it.

JakubNei avatar Jan 07 '18 11:01 JakubNei

(sorry! Thanks :) )

Arakade avatar Jan 07 '18 11:01 Arakade

Hey, sorry to pester but... any progress? Thx :)

Arakade avatar Mar 17 '18 15:03 Arakade

It still works (in 2018 beta at least) if you change the compatibility level of the project from ".NET 2.0 Subset" to ".NET 2.0" Edit > Project Settings > Player > Configuration - API Compatibility lvl. (found at https://answers.unity.com/questions/1373258/compilerparameters-not-found-in-systemcodedomcompi.html)

maschere avatar Apr 10 '18 20:04 maschere

In 2017.4.8 works fine if you change the compatibility level of the project from ".NET 2.0 Subset" to ".NET 2.0".

Vytek avatar Sep 01 '18 08:09 Vytek

Duh sorry about this, I don't plan on fixing this. If anyone wants, feel free to fix and create pull request. If I were to work on this, I would probably use Roslyn instead.

JakubNei avatar Nov 29 '18 00:11 JakubNei