question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

: WindowsPackageType is set to None, but GenerateAppxPackageOnBuild is set to true.

See original GitHub issue

Description

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:closed
  • Created a month ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mattleibowcommented, Aug 11, 2023

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.

0reactions
mattleibowcommented, Aug 16, 2023

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found