Default apphost should take platformtarget of app into account
See original GitHub issueWith x64 SDK on PATH:
- mkdir apphost
- cd apphost
dotnet new console
- Edit apphost.csproj, set PlatformTarget to x86
dotnet run
(or execute bin\Debug\netcoreapp3.0\apphost.exe directly)
Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'D:\Temp\apphost\bin\Debug\netcoreapp3.0\apphost.dll'. An attempt was made to load a program with an incorrect format
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Common error troubleshooting for Azure App Service and ...
Provides troubleshooting advice for the most common errors when hosting ASP.NET Core apps on Azure Apps Service and IIS.
Read more >Relationship between PlatformTarget and ...
In operation, you can specify Platform AnyCPU for building the app (indicating the app binary is appropriate for x86, x64, arm, etc., and...
Read more >Using Package Management Format in Rider
The default way to install NuGet packages in classic projects is to use a packages.config file, which by default can be found near...
Read more >Host ASP.NET Core on Windows with IIS
In web farm scenarios, an app can be configured to use a UNC path to store its data protection keyring. By default, the...
Read more >Building Microsoft Teams app in C# and XAML with Uno ...
Click Modify and let the installer do its magic. In a few moments you will have the tools installed. Microsoft 365 Developer Program...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think that
RuntimeIdentifier
is the “knob” for .NET Core. The problem here is that we have an implicit “runtime identifier” just for the apphost which only occurs whenRuntimeIdentifier
is not specified. The use ofPlatformTarget
would only help hint at the desired default architecture for the apphost in this case.Ideally, this is going to be a temporary measure for 3.0 anyway. I don’t like having to restore for an additional runtime for “runtime agnostic” builds just to get the platform-specific apphost. This will be how it works for the first preview of 3.0, but I’m hoping to replace this before 3.0 releases with a better mechanism that doesn’t pollute your assets graph just to enable this.
It occurs to me that fixing this will address a long-standing issue where F5 would use dotnet on path instead of dotnet with matching bitness. The default apphost can save us here. 😁