Skip to content
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

dotnet publish not working with dependent projects #9879

Closed
1 task
Tardigrade42 opened this issue Sep 2, 2022 · 13 comments
Closed
1 task

dotnet publish not working with dependent projects #9879

Tardigrade42 opened this issue Sep 2, 2022 · 13 comments
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging platform/windows 🪟 s/needs-attention Issue has more information and needs another look t/bug Something isn't working

Comments

@Tardigrade42
Copy link

Tardigrade42 commented Sep 2, 2022

Description

This issue is the same as #7268 which was closed because of missing information. So I had to make a new one.

The issue might by the way have constrains to multiple other building-issues, but I have not found anything completely similar.

The issue is, that I cannot build a Maui App with dotnet publish if it has dependencies to other projects of any kind.

Steps to Reproduce

  1. Create a Maui-App from the template
  2. Add another project of any type (Maui Class Library, Class Library > net 6.0 etc.) to the solution
  3. Add a dependency in the Maui-App for the other project
  4. Try to build it with one of the following commands:
    • For x86
      dotnet publish TestApp/TestApp.csproj -c Release -f:net6.0-windows10.0.19041.0 /p:GenerateAppxPackageOnBuild=true /p:Platform=x86 /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="<Your_Cert_Thumbprint>" /p:RuntimeIdentifier=win10-x86
    • For x64
      dotnet publish TestApp/TestApp.csproj -c Release -f:net6.0-windows10.0.19041.0 /p:GenerateAppxPackageOnBuild=true /p:Platform=x64 /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="<Your_Cert_Thumbprint>"

(Both commands are for the Windows Powershell)

In both cases, the following command is showing up:
*:\Users\***\.nuget\packages\microsoft.windowsappsdk\1.1.3\buildTransitive\Microsoft.Build.Msix.Packaging.targets(138,5): error : Improper project configuration: WindowsPackageType is set to None, but GenerateAppxPackageOnBuild is set to true. [*:\Users\***\Desktop\ TestApp\TestLib\TestLib.csproj]

(TestLib is the NET Maui Classlibrary I added).

Note: After you add the dependency in TestApp, make sure, that the .csproj file has saved. Otherwise, the error is not showing up. (This was an issue I just ran into)

Link to public reproduction project repository

https://github.com/Tardigrade42/Maui-Issue-9879

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

I guess all Windows versions

Did you find any workaround?

A 'workaround' was to put everything into one project.

Relevant log output

No response

Depends on

@Tardigrade42 Tardigrade42 added the t/bug Something isn't working label Sep 2, 2022
@AlanGusLive
Copy link

Related issue: #9547
Scheduled: .NET 7 Planning

@jsuarezruiz jsuarezruiz added area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) platform/windows 🪟 labels Sep 5, 2022
@jfversluis
Copy link
Member

As requested by the bug report template: can you please add a reproduction project with how you've set this all up? That will make it most clear what you're trying to do exactly and hopefully it will be easy for us to point out what might not look right or where a potential issue is, thanks!

@jfversluis jfversluis added the s/needs-repro Attach a solution or code which reproduces the issue label Sep 5, 2022
@ghost
Copy link

ghost commented Sep 5, 2022

Hi @Tardigrade42. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

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.

@Tardigrade42
Copy link
Author

@jfversluis: I added a repository to the original comment. I have also set up two actions to show the issue (yes, they base on your tutorial ;) ). You can find more details on how to reproduce the issue locally in the README of the repo.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Sep 6, 2022
@mattleibow mattleibow added this to the Backlog milestone Sep 6, 2022
@mattleibow mattleibow removed the s/needs-attention Issue has more information and needs another look label Sep 6, 2022
@ghost
Copy link

ghost commented Sep 6, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@mattleibow mattleibow added the area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging label Sep 6, 2022
@mattleibow
Copy link
Member

mattleibow commented Sep 6, 2022

After a bunch of things and testing, I think there is a few bugs somewhere in the tooling parts of the system:

There is a workaround for now:

Add this to the bottom of the app .csproj:

<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows' and '$(RuntimeIdentifierOverride)' != ''">
	<RuntimeIdentifier>$(RuntimeIdentifierOverride)</RuntimeIdentifier>
</PropertyGroup>

Then when executing, use the new property instead of the RID:

dotnet publish MyApp.csproj -c Release -f net6.0-windows10.0.19041.0 /p:RuntimeIdentifierOverride=win10-x86

See also my PR: Tardigrade42/Maui-Issue-9879#2

@mattleibow
Copy link
Member

mattleibow commented Sep 6, 2022

I am going to close this issue as there is not much we can do for now. Hopefully the workaround is sufficient for now the fix comes soon in the new version of Windows App SDK.

@Tardigrade42 let me know if this helps at all.

@mattleibow mattleibow closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2022
@mattleibow mattleibow reopened this Sep 6, 2022
@mattleibow mattleibow added the s/needs-info Issue needs more info from the author label Sep 6, 2022
@ghost
Copy link

ghost commented Sep 6, 2022

Hi @Tardigrade42. 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.

@Tardigrade42
Copy link
Author

Good morning @mattleibow,
thanks for the fast fix :) . It works fine for me. From my point of view, we can close the issue.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Sep 7, 2022
@Tardigrade42
Copy link
Author

I have on short question left:
All the time, I build a Maui application with dotnet publish, I get the following warning:

C:\Users\runneradmin\.nuget\packages\microsoft.windowsappsdk\1.1.3\buildTransitive\Microsoft.Build.Msix.Packaging.targets(341,5): warning : Path to `mspdbcmf.exe` could not be found. A symbols package will not be generated. Review https://aka.ms/windowsappsdkdocs and ensure that all prerequisites for Windows App SDK development have been installed. [D:\a\Maui-Issue-9879\Maui-Issue-9879\TestIssue9879\MauiApplication\MauiApplication.csproj]

This warning can also be seen in your last GitHub Actions:
x86 run
x64 run

Is this of any concern / Is mspdbcmf.exe important? Or can I ignore this warning?

@mattleibow
Copy link
Member

Awesome!

This warning is just that a special symbols package is not going to be created. This is safe to ignore, but might make debugging issues from the Store harder.

Could you open an issue about this warning on https://github.com/microsoft/WindowsAppSDK?

@mattleibow mattleibow closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Oct 7, 2022
@mattleibow
Copy link
Member

Moved the WASDK issue to microsoft/WindowsAppSDK#3337

@mattleibow
Copy link
Member

Duplicate of #9547

@mattleibow mattleibow marked this as a duplicate of #9547 Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging platform/windows 🪟 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants