I am trying to publish an update for a .NET Maui app that has been in production for over a year. I’ve made several updates to the app, without issue. However, I recently had to get a new computer, and now I am unable to update the app. I am using (and have used) the following method to publish from the CLI, using PowerShell from a Visual Studio terminal:
dotnet publish myapp.csproj -f net8.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64
In the past, this has given me the desired msix package, which I am able to share with my team who needs to run the program. However, I am now encountering the following error when I run this publish command:
Error: Input file with ‘.DLL’ extension not supported.
I have looked high and low for a solution to this, read up on similar issues, but nothing seems to be the same as my issue. I have tried to clean/rebuild, unload/reload my project, and have reviewed all my properties and settings, but am unable to see anything there that would suggest changing it might fix the problem. I have also deleted the folder containing the solution, and re-cloned the entire thing from github. I have restarted my computer, restarted and updated Visual Studio.
Per @Serg’s suggestion, I ran the build with the -bl flag. This gave me a different, unexpected error that I hadn’t seen before:
error: Packaged .NET applications with an app host exe cannot be ProcessorArchitecture nuetral. Please specify a RuntimeIdentifier or a Platform other than AnyCPU.
I updated my .csproj file to specify an x64 platform, with a runtime identifier of win-10-x64. I have added the following to the top-level of this file, as well as the conditional for release and all others (!= ”):
<Platforms>x64</Platforms>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
Both problems still persist.
1
After a lot of banging my head against the wall, on a whim I tried to pack my .csproj file to see if that would give me anything useful, and it did! Specifically, it led me to adding the following to my csproj file:
<PropertyGroup>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
After adding this, I was able to publish successfully.