I have two identical ASP.Net 4.6 MVC project, project 1 is using roslyn complier within the site which is working fine.
c:\windows\system32\inetsrv>C:\Websites1\bin\roslyn\csc.exe Microsoft (R) Visual C# Compiler version 1.2.0.60325
With the second project I'm getting the error below, it's using the complier from .Net framework.
c:\windows\system32\inetsrv> "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe" Microsoft (R) Visual C# Compiler version 4.6.1590.0
Line 6: @if (!Model?.Item?.IsDerived(Templates.PageMetadata.ID) ?? true)
Line 7: {
Line 8: return;
c:\Website2\Views\metadata.cshtml(6,17): error CS1525: Invalid expression term '.'
c:\Website2\Views\metadata.cshtml(6,18): error CS1003: Syntax error, ':' expected
c:\Website2\Views\metadata.cshtml(6,23): error CS1525: Invalid expression term '.'
c:\Website2\Views\metadata.cshtml(6,24): error CS1003: Syntax error, ':' expected
c:\Website2\Views\metadata.cshtml(6,68): error CS1002: ; expected
c:\Website2\Views\metadata.cshtml(6,68): error CS1525: Invalid expression term ')'
c:\Website2\Views\metadata.cshtml(6,69): error CS1002: ; expected
I've used Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform on both project.
My question is why is the second project not using roslyn complier and is there a way to force it to use the roslyn complier within the site?
I've also tried Microsoft.Net.Compilers nuget package.