-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Precompiled views not happening for self-contained apps #2268
Comments
@Petermarcu was this initially reported in a different repo? |
Not that I know of. I found this as I was trying to prototype a solution for some customers. |
Ahh, I assumed you were porting this from a different repo and forgot to link it. We took out support for precompilation in 2.0.0 for standalone applications. This is fixed as part of 2.1.0 (aspnet/MvcPrecompilation#102). |
Is there a reason it was pulled out in 2.0? There is a doubly bad problem for self contained apps in 2.0. First, pre-compilation doesn't work. Second, self-contained apps are using a Roslyn that is not crossgen'd. |
I see, its related to being able to do the right thing based on the target rid (cross publish). Is that fix something that will show up for me as long as I use the newer SDK even if I target .NET Core 2.0? |
Unfortunately not. The fix was made in the package's target so you'd have to update to our nightly to get it. The workaround we've been recommending for the 2.0.0 release is to publish it as a portable application and copy the precompiled binary to the standalone publish directory:
|
Ok, I can probably do that for now. The company I'm working with is writing their own CLI tool chain as well so they will probably need to automate this workaround for their customers in their tools. |
Great. Feel free to message me if you run in to issues. I'll close this since there's nothing further to do here. |
Is there any way to get the fix into something that doesn't ship in the newer packages and instead is delivered with the sdk so people don't have to jump to the latest target framework just to get this? These types of fixes seem like they should be sdk fixes that apply to all runtimes and not tied to a runtime version. |
We could consider porting the fix to a patch release. There weren't any API changes, just changes to how we invoke the precompilation tool so it's a low risk change. cc @Eilon for thoughts on this. |
Alternatively, is there a way for me to pull a package in that just has these targets and not move everything in MVC up to 2.1? |
I noticed startup time was absolutely terrible for my self-contained mvc application. I created a empty mvc project to try to repro.
dotnet new mvc
When I
dotnet publish
I get a folder with a PrecompiledViews.dll and the app starts really fast.When I
dotnet publish -r win-x64
I don't see the PrecompiledViews.dll and my app takes 3-4 seconds to start each time.What do I need to do to get precompiled views for my self contained mvc application?
I tried adding:
To my project and that didn't seem to have any effect.
The text was updated successfully, but these errors were encountered: