: WindowsPackageType is set to None, but GenerateAppxPackageOnBuild is set to true.
See original GitHub issueDescription
when I try to publish the following solution
https://github.com/nicolgit/Open.Padlock/
I receive the following error:
error : Improper project configuration: WindowsPackageType is set to None, but GenerateAppxPackageOnBuild is set to true. [C:\myprojects\github\Open.Padlock\code\Blast.Model\Blast.Model.csproj::TargetFramework=net7.0-windows1 0.0.19041.0]
Steps to Reproduce
clone https://github.com/nicolgit/Open.Padlock/
execute the following
dotnet publish code/Blast/Blast.sln -c Release -f:net7.0-windows10.0.19041.0 /p:GenerateAppxPackageOnBuild=true /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="<your thumbprint"
Link to public reproduction project repository
https://github.com/nicolgit/Open.Padlock/
Version with bug
7.0.92
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
no
Relevant log output
No response
Issue Analytics
- State:
- Created a month ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
maui - WindowsPackageType is set to None, but ...
WindowsPackageType is set to None, but GenerateAppxPackageOnBuild is set to true. I create a new project and Follow the same Steps to create ......
Read more >Windows Publish failing with WindowsPackageType is set ...
Fails with "Improper project configuration: WindowsPackageType is set to None, but PublishAppxPackage is set to true."
Read more >MAUI solution with apps and DLLs fails to generate ...
"Improper project configuration: WindowsPackageType is set to None, but PublishAppxPackage is set to true." Describe how to reproduce. The ...
Read more >Package your app using single-project MSIX - Windows apps
This article provides instructions for how to generate an MSIX desktop app via a single project in Visual Studio.
Read more >Welcome to Hell - Windows Publishing with .NET MAUI
I experimented with AOT and ReadyToRun builds (with and without trimming) which all work fine, but as soon I set to true the...
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 this issue is happening because you are passing the
GenerateAppxPackageOnBuild=true
on a solution build - which is instructing all projects (including libraries) to produce .appX packages. I understand this does not make sense, but the WinUI targets maybe are not able to decide what you are trying to do.I would open an issue over there: https://github.com/microsoft/WindowsAppSDK/issues
A workaround/alternate solution would be to either set this property directly in your app csproj - or - instead of building the solution, you would build the project. If you publish a solution, it will try publish every project in it. If you publish a project, it just publishes the single.
Also, a publish does not need the GenerateAppxPackageOnBuild property as that is now implicit with a publish of an app project.
Let me know if this helps.
Glad to hear the building of the project worked. I am going to close this issue because publishing a project is the correct way to publish apps.