-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish Unpackaged Apps Error(Project Reference MAUI Library ) #9064
Comments
Can confirm the problems. Updated my Visual Studio 2022 to Version 17.6.2 and now my .NET 7 MAUI Blazor application can't publish with -p:WindowsAppSDKSelfContained=true. The problems occus when a class library project is added and referenced. |
Hey guys I may found a workaround that I want to share with you.
/obj/Release/net7.0-windowsxxxxx/win10-x64/MsixContent/
/obj/Release/net7.0-windowsxxxxx/win10-x64/
Well you got the idea..you need to provide an AppxManifest.xml. Not quite sure if its a problem if I just copy it from the "main" project to the other solutions, but it worked for me so far. I hope that may give some hints for the devs to find the bug. |
I believe this is fixed for apps. But the real issue is that publishing only works if you pass the project and not a solution. It will try publish the library project as an app, which is not supported. This is an old issue, but did you manage to publish the app? |
Hi @bflyman. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. |
Lets say I have a solution that contains a "main" project and a library project. It would fail in both scenarios when the main project references the library project. The error occured randomely, but I could always resolve it with a copy of AppxManifest.xml. So yes app publishing works, but only if you know what you are doing. |
I am pretty sure there is an authoring issue in the WinUI targets. If you set the I think this is the same issue where setting the RuntimeIdentifier on the CLI tries to make library projects into apps. microsoft/WindowsAppSDK#3337 To work around this I have to add this to csprojs that want a RID-specific build: <PropertyGroup Condition="'$(RuntimeIdentifierOverride)' != ''">
<RuntimeIdentifier>$(RuntimeIdentifierOverride)</RuntimeIdentifier>
</PropertyGroup> This could then be replicated and used to set the property on the CLI: <PropertyGroup Condition="'$(WindowsAppSDKSelfContainedOverride)' != ''">
<WindowsAppSDKSelfContained>$(WindowsAppSDKSelfContainedOverride)</WindowsAppSDKSelfContained>
</PropertyGroup> It is unfortunate, but there seems to be an ordering issue where setting properties trigger targets to do things even when they are not relevant for the project. I logged another issue on this as well: microsoft/WindowsAppSDK#4008 So, as a workaround for now, you can:
|
Hi @bflyman. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. |
Description
I created a MAUI APP using the following command and the resulting EXE works just fine.
dotnet publish -f net6.0-windows10.0.22621.0 -p:WindowsPackageType=None -p:SelfContained=true -p:WindowsAppSDKSelfContained=true -p:GenerateAppxPackageOnBuild=false
But when I created a MAUI Libaray and referenced it in my APP project, the above publish command failed
The main error messages are:
Could not find a part of the path 'J:\TestProject\MauiLib2\obj\Debug\net6.0-windows10.0.19041.0\MsixContent\AppxManifest.xml'. [J:\TestProject\MauiLib2\MauiLib2.csproj]
Steps to Reproduce
1.create Maui APP
2.create Maui Lib
3. APP Project Reference Lib
4. App MainPage.cs Add a little code
Lib.Class1 c = new Lib.Class1();
builder.Services.AddSingleton(c);
PS:The generation succeeds without adding code.
Version with bug
6.0.400
Last version that worked well
6.0.400
Affected platforms
Windows
Affected platform versions
Windows
Did you find any workaround?
pack Maui libaray and add package the libaray
Relevant log output
The text was updated successfully, but these errors were encountered: