Deploying 32-bit app
Does "deploy a 32-bit app unless the app..." mean that when deploying from Visual Studio to Windows platform, one should select target runtime "win-x86" instead of "portable"?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: ec484002-18c1-6a0d-00de-820d56f038d3
- Version Independent ID: 7903ce53-2cbb-f083-7479-c8abc30211a0
- Content: Host ASP.NET Core on Windows with IIS
- Content Source: aspnetcore/host-and-deploy/iis/index.md
- Product: aspnet-core
- Technology: aspnetcore-hostdeploy
- GitHub Login: @guardrex
- Microsoft Alias: riande
Hello @mcurko ... Yes ... sorry for the delay. Today has been 🏃😅 all day.
The answer is 'yes' ... you'll get a published Framework-Dependent Deployment for x86, and you'll need the .NET Core x86 runtime installed to run it.
For example if you have the 2.2.3 x86 runtime installed, you can set that Target Runtime to win-x86 (leaving the Deployment Mode to Framework-Dependent). You get an app that will run with the 32-bit dotnet.exe found in c:\Program Files (x86)\dotnet folder as long as you have 2.2.3's runtime installed for x86. [Or, just run the .exe in the published output ... a "framework-dependent executable" is what they call that.]
I went to test my own IIS setup with one of my test apps here for this. I had a problem a few days ago with bad ASP.NET Core Modules from a bad Preview 3 hosting bundle install that I did. My x64 64-bit apps run just fine on IIS/ANCM with the repairs that we made ... however ... I go to put this x86 test app on IIS here ... and :boom::cry: I'm NOT going to try to repair that today. lol ... I'm exhausted.
In theory, @mcurko, you should be able to deploy that app to IIS, set the app pool to Enable 32-bit Applications with True.
With your good ANCM (not a broken setup like I have), it should ✨ Just Work:tm: ✨.
Leave this issue open even if you get things working on your IIS/ANCM. I'd like to inquire with the engineers on this because I'd like to know why if Target Runtime is Portable the default app bitness is x64 ... if that's the default OOB experience (or default with x64 VS2019, which is what I installed here) ... should we change this language a little bit in the topic? Should we link to instructions or have a section in the topic that further elaborates on VS/publishing and bitness? Leave this issue open.
Note to self:
crit: Microsoft.AspNetCore.Hosting.Internal.GenericWebHostService[6]
Application startup exception
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Microsoft.AspNetCore.Builder.IApplicationBuilder Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseRouting(Microsoft.AspNetCore.Builder.IApplicationBuilder, System.Action`1<Microsoft.AspNetCore.Routing.IEndpointRouteBuilder>)'.
at testselfcontained.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env, IOptionsMonitor`1 dpo)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.Internal.GenericWebHostBuilder.<>c__DisplayClass13_0.<UseStartup>b__2(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
@guardrex I am getting the error that you identified, when I deploy to an IIS server, but not when I run inside of Visual Studio. .NET Core 3.0.0-preview4-27615-11 X64 v4.0.0.0 Is there a resolution to this?
MissingMethodException: Method not found: 'Microsoft.AspNetCore.Builder.IApplicationBuilder Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseRouting(Microsoft.AspNetCore.Builder.IApplicationBuilder, System.Action1<Microsoft.AspNetCore.Routing.IEndpointRouteBuilder>)'.`
Thanks.
@dpedrelli I don't have additional info on it beyond what engineering says generally: Use 32-bit tooling to produce 32-bits apps. Idk if using the 32-bit VS resolves that, but that is possible. Idk if it's a known problem that the VS team is aware of. It doesn't currently show up in the ASP.NET Core issues (open or closed).
You can open it on the aspnet/AspNetCore issues. If they say that it's a VS tooling problem, then they'll probably instruct you to use the Report a Problem process built-into VS to report it: It generates an issue internally for the VS tooling folks.
If you open an engineering issue, paste a link to that into this convo so that I can track on it for the docs.