Skip to content

Fail to copy Roslyn compiler bits to the right location on build server #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Jinhuafei opened this issue Apr 6, 2017 · 10 comments
Closed
Labels

Comments

@Jinhuafei
Copy link
Contributor

See SO issue.

@vascofernandes
Copy link

Also affected by this problem.

@niemyjski
Copy link

I'm also affected by this. I need to be able to control the path.

@ejsmith
Copy link

ejsmith commented May 30, 2017

Actually, my question is why do we even need to shell csc.exe in the 1st place? Why can't we just use the Roslyn API to compile the code?

@Jinhuafei
Copy link
Contributor Author

@ejsmith DotNetCompilerPlatform is for runtime compilation(e.g. aspx/cshtml/global.asax etc..). It is implemented as a language provider which is the only way asp.net provides to do the runtime compilation.

@niemyjski
Copy link

niemyjski commented May 30, 2017

@Jinhuafei Yes, we get that, but it's implemented as a code Dom provider which just shells the compiler with command line arguments. What we are asking is why doesn't the code dom provider just compile in process using roslyn instead of shelling it (an out of process compiler which uses roslyn).

@davidfowl
Copy link
Member

The problem was controlling the memory allocated by the compiler in certain cases. There are some generated code patterns that the aspx code generator generates that cause the Roslyn compiler to either stackoverflow or run out of memory parsing. The only way to fix that was to run then compiler out of process (since there were no changes being made to code gen)

@ejsmith
Copy link

ejsmith commented May 30, 2017

@davidfowl that makes sense. Is ASPNET Core still taking the out of process approach as well then?

@Jinhuafei
Copy link
Contributor Author

David is right. We tried both, and out-proc compilation model works better. Besides what David mentioned, we also saw working set increment in w3wp process when using in-proc compilation.

@davidfowl
Copy link
Member

davidfowl commented May 31, 2017

@davidfowl that makes sense. Is ASPNET Core still taking the out of process approach as well then?

We discussed it but haven't built in the infrastructure to make that work as well as ASP.NET (see ASP.NET Temporary Files). We also changed some of the code generation patterns in Razor to help the issue a bit. On top of that, we also now pre-compile views by default in on publish so your production site should never really be using roslyn at runtime.

@Jinhuafei
Copy link
Contributor Author

The fix is included in 1.0.6 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants