-
Notifications
You must be signed in to change notification settings - Fork 1.1k
UseCommonOutputDirectory=true breaks CopyLocalLockFileAssemblies flag #23342
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
Comments
Also, if I set verbosity level to "Detailed", I see messages like:
If it's not too complicated and somebody can help me by telling me where to look to fix the issue, I could try to fix it in my spare time. |
The message about "CopyLocal" and "Private" comes even if you don't set UseCommonOutputDirectory. The DLL in the package would normally be copied by the _CopyFilesMarkedCopyLocal target, but if |
@KalleOlaviNiemitalo thanks for the explanation. |
This is clear regression in dotnet 6. Projects with Is there any update on when to expect solution? Building the solution to one directory, in order to save resources, should not be something impossible. Note that for net6.0 projects without |
Thanks for documenting this @jozefsivek I am seeing this regression as well |
I'm trying to upgrade a working .NET 5 project that uses
|
@bkoelman Maybe your Test Project use UseCommonOutputDirectory=true ? |
@yzbai Thanks, that helps. I had <PropertyGroup Condition="!$(MSBuildProjectName.EndsWith('Test'))"> Unfortunately, that brings me back to the original issue that DLLs from NuGet dependencies aren't being copied. Adding |
Related: #27320 - UseCommonOutputDirectory breaks dotnet test |
If it helps, I posted a possible solution here which allows you to not set |
I am observing the same issue in .NET 6 projects. |
Any word on a fix for this? Pretty annoying. Have to remember to copy new stuff to the output directory. |
Old issue triage: @rainersigwald is this just a known gap in UseCommonOutputDirectory? Any suggestions? |
FWIW, it might be worth us documenting all the recommended ways of managing outputs for projects. We could also explore the concept of a metaproject that pulls together the outputs of all the dependencies that gives the result of UseCommonOutputDirectory but works better. |
I agree, this is area is a deep source of misery, especially when you
combine multiple framework targets, native dlls, xplat, package publishing,
and unit testing. Having some approach that actually works would be
incredible.
…On Tue, May 20, 2025, 2:51 PM Marc Paine ***@***.***> wrote:
*marcpopMSFT* left a comment (dotnet/sdk#23342)
<#23342 (comment)>
FWIW, it might be worth us documenting all the recommended ways of
managing outputs for projects. We could also explore the concept of a
metaproject that pulls together the outputs of all the dependencies that
gives the result of UseCommonOutputDirectory but works better.
—
Reply to this email directly, view it on GitHub
<#23342 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA2LHYROYOKQRIEQGGPQC327OIUNAVCNFSM6AAAAABRU3ZXLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOJVHAYDCMJZGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Per discussion on #23366, for some people setting |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
NuGet dependencies aren't getting copied if I set UseCommonOutputDirectory=true and CopyLocalLockFileAssemblies=true in my .csproj file.
To Reproduce
What happens: It crashes with
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'CJE, Version=3.3.10.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
because no dll was copied to output directory.
What should happen: CJE.dll should be copied to output dir during building process and console should print
Hello World!CJE.Event
.Further technical details
dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.101
Commit: ef49f62
Runtime Environment:
OS Name: ubuntu
OS Version: 21.10
OS Platform: Linux
RID: ubuntu.21.10-x64
Base Path: /usr/share/dotnet/sdk/6.0.101/
Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc
.NET SDKs installed:
5.0.404 [/usr/share/dotnet/sdk]
6.0.101 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
JetBrains Rider 2021.3.2, but works the same if I use
dotnent run
in project dirI'm trying to use UseCommonOutputDirectory because this comment suggested this and I need to build my projects to one common directory.
The text was updated successfully, but these errors were encountered: