What / why is Roslyn “needed” in /bin folder of Asp.Net

前端 未结 5 1893
-上瘾入骨i
-上瘾入骨i 2020-12-05 09:05

There are a bunch of related questions on this, though most of the answers define Roslyn and/or provide a \"fix\" to some issue (exe, with hosting prov

5条回答
  •  北海茫月
    2020-12-05 09:38

    Two things to note: 1) Removing it will "fix" the problem, but it "fix"es it by falling back to a built-in, old, legacy compiler that is not compatible with later language features.
    2) Pre-compiling is not possible in many cases. How would you show information in a model if it's pre-compiled, and then show changes to that data? Any data that you rely on in partial views to refresh would never update.

    Another point of interest is to make sure you are tracking the "build" directory in the roslyn's package. If you don't, it won't thrown an error but it will not compile your site when you try to load it. Fully tracked, it just works. We deployed it to other development systems without installing it on those systems first, and this is possible because it's a NuGet package.

提交回复
热议问题