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.

With UseMaui = true in class library I get a '"CopyLocalFilesOutputGroup" does not exist' error

See original GitHub issue

Description

When I create a class library for reusable maui components and add <UseMaui>true</UseMaui> to the csproj I get this error: C:\Program Files\dotnet\packs\Microsoft.Maui.Sdk\6.0.300-rc.2.5513\Sdk\WinUI.NetCore.targets(188,5): error MSB4057: The target "CopyLocalFilesOutputGroup" does not exist in the project. C:\Program Files\dotnet\packs\Microsoft.Maui.Sdk\6.0.300-rc.2.5513\Sdk\WinUI.NetCore.targets

Used rc2 and VS preview 5

I am not sure if I am supposed to use <UseMaui>true</UseMaui> for this purpose. I would like to know the alternative way if there is one. Still there may have to be a better error in this situation.

Screenshot of the situation: image

Minimal reproduction: CopyLocalFilesOutputGroup-does-not-exist.zip

Steps to Reproduce

  1. Create a new maui app
  2. Create a new class library
  3. Add <UseMaui>true</UseMaui> to the csproj of the class library
  4. Add a reference to the class library in the maui app
  5. Compile.

Version with bug

Release Candidate 2

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

It is a compile problem so I guess it affects all platforms with RC 2. I compiled on Windows.

Did you find any workaround?

No

Relevant log output

Build started...
1>------ Build started: Project: ClassLibrary1, Configuration: Debug Any CPU ------
1>You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
1>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers.
1>ClassLibrary1 -> C:\Users\pauld\source\repos\MauiApp3\ClassLibrary1\bin\Debug\net6.0\ClassLibrary1.dll
2>------ Build started: Project: MauiApp3, Configuration: Debug Any CPU ------
2>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers.
2>MauiApp3 -> C:\Users\pauld\source\repos\MauiApp3\MauiApp3\bin\Debug\net6.0-windows10.0.19041.0\win10-x64\MauiApp3.dll
2>C:\Program Files\dotnet\packs\Microsoft.Maui.Sdk\6.0.300-rc.2.5513\Sdk\WinUI.NetCore.targets(188,5): error MSB4057: The target "CopyLocalFilesOutputGroup" does not exist in the project.  C:\Program Files\dotnet\packs\Microsoft.Maui.Sdk\6.0.300-rc.2.5513\Sdk\WinUI.NetCore.targets
2>Done building project "ClassLibrary1.csproj" -- FAILED.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:5
  • Comments:42 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
mattleibowcommented, May 5, 2022

Yeah. 😦 Windows errors are crazy hard to debug. Usually when this happens I check the C++ and CLR check boxes in the Exception Settings window - not perfect, but catches more exceptions (be warned WinUI throws a bit but you have to continue through as they are caught elsewhere):

image

3reactions
KlaasTroostcommented, Apr 29, 2022

At this moment I use:

	<UseMaui>true</UseMaui>
	<SingleProject>true</SingleProject>
	<ImplicitUsings>enable</ImplicitUsings>
	<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>

these are settings in my Windows project. But still no succes, I am getting a little frustrated now. Everything worked till de Release Candidates.

When RC1 was released I had some problems but I fixed them. But since RC2 (when you think it should getting better) the project can not be build.

Read more comments on GitHub >

github_iconTop Results From Across the Web

With UseMaui = true in class library I get a ' ...
With UseMaui = true in class library I get a '"CopyLocalFilesOutputGroup" does not exist' error #3025. Sign in to view logs · Sign...
Read more >
Issue with Razor Class Library in MAUI while publishing ...
With an empty MAUI project I was able to publish and generate .ipa. Once I add Razor Class Library I get below error....
Read more >
C# class from library not found or does not exist
I have a C# WinForms program and I created also a C# library. I added in the main project a reference to the...
Read more >
Unable to access reference project class library in console ...
When referencing the library you have to right click dependencies and choose "Project Reference". Then click "Browse". You now have to browse to ......
Read more >
Intro To Class Libraries in C# - YouTube
Got up this morning to have coffee, found this in my feed!!!! Your channel is state of the art Tim. You don't make...
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