dotnet / aspnetcore Public
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
After installing 6.0.5 update, 6.0.4 Blazor app Windows service stops #41664
Comments
@mrlife thanks for contacting us. Is this a Blazor Server application? |
@javiercn Yes, it's Blazor Server. |
@mrlife is it a self-contained deployment? |
@mrlife I think you might have a mismatch on the dependencies. I'm not sure how you are doing the deployment, but I would suggest ensuring that the folder you are deploying the files to is clean as well as that you do a clean publish. |
Hi @mrlife. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@javiercn I believe it's not self-contained, since I run this command, which doesn't have
and my-profile.pubxml contains:
Would installing a new version of ASP.NET Core really have an effect on an existing app that doesn't use the new version and wasn't changed at all? |
@mrlife did you re-publish the app or was the only thing that you did install the new runtime and restart the service. |
Hi @mrlife. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@javiercn I didn't republish the app or restart the service, only installed the 6.0.5 update. Do we need to restart all apps after installing an update? |
@mrlife I don't believe so, but I can't tell what happened here right away. I'll let some other folks chime in. I'm untagging Blazor since I don't think this is a Blazor specific behavior. @dotnet/aspnet-build @Pilchie can you route this to the right place? From what I understand, installing 6.0.5 causes some already running apps to fail. |
@mrlife it looks like you are using the 3.1.405 SDK, and have the 6.0.5 Asp.Net runtime installed - what is the |
@wtgodbe I have the latest SDK on my development machine. The issue template I guess is a little unclear to me then; it just says .NET version, so I put in the |
Could you share your app with us so we can try to get a repro? The error message you showed typically happens when your project file doesn't have its |
@wtgodbe I can share some redacted code, but I can't provide the app itself. If there's any specific code you'd like, please let me know. |
@mrlife just the .csproj should be sufficient, and if there is a |
Sorry, should have said all .csproj files in the solution, and note which one you're actually running when you see the failure |
There's only one project in the solution, so no worries there. Here it is: <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<DefaultAppHostRuntimeIdentifier>win-x64</DefaultAppHostRuntimeIdentifier>
<RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="6.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.5" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="6.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.4" />
</ItemGroup>
</Project> |
Nothing there looks suspicious, the only thing that looks suspect so far is that the host server reports using SDK 3.1.405. Could you try restarting the service & republishing, and/or installing https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.300-windows-x64-installer on the host server and running again? |
@wtgodbe Just to double check, the host doesn't normally need the SDK right, just the runtime? |
I believe that's correct, though I'm not 100% sure, @BrennanConroy @halter73 or @Tratcher may be able to confirm. Have you previously updated from e.g. 6.0.3 to 6.0.4 without issue? Or is this the first time you've done an in-place update within the 6.0 band? As best I can tell, @javiercn's suggestion about restarting/republishing is the most likely fix, as maybe the output directory of your app no longer matches what the project is expecting after updating to 6.0.5. |
I updated the host to 6.0.5 but did not touch the app that's on 6.0.4 and threw the error. I have done multiple 6.0 band updates previously and haven't run into this before. |
Did you install via the hosting bundle or via the standalone asp.net runtime installer? |
This was the Windows hosting bundle. |
Installing the 6.0.5 hosting bundle on a machine will remove any older 6.0.x runtimes & replace them with the 6.0.5 one - so if your running app had resolved the old 6.0.4 location of |
That's interesting, and not something I would have suspected. Thanks for letting me know. I guess that means 6.0.4 apps can run on 6.0.5 hosts (no 6.0.4 installed) as long as those app services are restarted after the hosting bundle update? |
That's my expectation, yes. In general, a X.Y.Z app should be able to run on any X.Y.N app, so long as N >= Z. |
Take a look at https://docs.microsoft.com/dotnet/core/versions/selection#framework-dependent-apps-roll-forward for details of how roll forward works. |
@wtgodbe Thank you. @Pilchie I think the chances I would find a way to that documentation location are small, so thanks for pointing that out. Sounds like if one application is updated on e.g. 6.x.x band, then all applications must either be updated or have their Windows service restarted, and 6.x.x band versions are backward compatible. Sound right? |
In general there are a few things to consider:
|
Is there an existing issue for this?
Describe the bug
After installing the ASP.NET Core 6.0.5 update, a Blazer app on 6.0.4 stopped working. When accessing the application, its Windows service stopped and the below exception was available in Event Viewer.
Expected Behavior
An app running on an installed, previous version should not be affected by installing a new version.
Steps To Reproduce
Exceptions (if any)
Category: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware
EventId: 1
SpanId: 0787f7fc282181ed
TraceId: fd53f8e7c33f2326e3bf6d17b2913867
ParentId: 0000000000000000
ConnectionId: 0HMHK2N15TMR9
RequestId: 0HMHK2N15TMR9:00000002
RequestPath: /
An unhandled exception has occurred while executing the request.
Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.WebUtilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
File name: 'Microsoft.AspNetCore.WebUtilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Microsoft.AspNetCore.Antiforgery.AntiforgeryOptionsSetup.ComputeCookieName(String applicationId)
at Microsoft.AspNetCore.Antiforgery.AntiforgeryOptionsSetup.Configure(AntiforgeryOptions options)
at Microsoft.Extensions.Options.OptionsFactory
1.Create(String name) at Microsoft.Extensions.Options.UnnamedOptionsManager
1.get_Value()at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenStore..ctor(IOptions
1 optionsAccessor) at System.RuntimeMethodHandle.InvokeMethod(Object target, Span
1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSite(ServiceCallSite callSite, TArgument argument)at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType) at System.Collections.Concurrent.ConcurrentDictionary
2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Microsoft.AspNetCore.Mvc.AutoValidateAntiforgeryTokenAttribute.CreateInstance(IServiceProvider serviceProvider) at Microsoft.AspNetCore.Mvc.Filters.DefaultFilterProvider.ProvideFilter(FilterProviderContext context, FilterItem filterItem) at Microsoft.AspNetCore.Mvc.Filters.DefaultFilterProvider.OnProvidersExecuting(FilterProviderContext context) at Microsoft.AspNetCore.Mvc.Filters.FilterFactory.CreateUncachedFiltersCore(IFilterProvider[] filterProviders, ActionContext actionContext, List
1 filterItems)at Microsoft.AspNetCore.Mvc.Filters.FilterFactory.GetAllFilters(IFilterProvider[] filterProviders, ActionContext actionContext)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvokerCache.GetCachedResult(ActionContext actionContext)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageRequestDelegateFactory.<>c__DisplayClass13_0.b__0(HttpContext context)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
.NET Version
3.1.405
Anything else?
No response
The text was updated successfully, but these errors were encountered: