File being output twice (with and without project name in the path) #9750
Unanswered
Gavin-Williams
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I installed project system tools and recorded a build. Going down through it I found...
And a whole heap of items, including the example .png I mention here are listed twice with the two paths. So what? I don't know. This just tells me that it's doing what I thought it was doing. It says the source file is:
And the parent is
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have some files that are being output twice to the output directory. Considering one of the files, it is set to
BuildAction = Content
Copy to Output Directory = Copy if newer
And the file is mentioned in the libraries csproj file as follows...
<Content Update="UI\Controls\Terminal\C64_16px1p.png"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content>
In the project that uses the library, why do I get 2 different copies of the file in its output directory? They have the following paths...
bin / debug / net8.0 / Framework / UI / Controls / Terminal / C64_16px1p.png
bin / debug / net8.0 / UI / Controls / Terminal / C64_16px1p.png
Likewise, there are two copies with the same folder structure in the library project as well. I deleted bin and obj before building. And this crazy folder structure was recreated.
I made a small test solution to try to reproduce this behavior, and I couldn't. It does what's expected and only produces a single file in the output. So whatever has happened here, may only occur in larger projects as a hidden consequence of work.
bin/ debug / net8.0 / UI / LibShader.hlsl // without the project name in the path.
Note: This becomes important, because as of yesterday VS has stopped respecting Copy-if-newer and Copy-always. It looks like one of the copies is being updated, but not the other one - not the one that is actually used. Which means builds aren't working. Because file changes aren't visible to my code when it loads hlsl files.
I want visual studio to only output a single copy, and keep it updated, so that I know where to load the file from in a way that isn't like rolling a dice for success or failure.
Beta Was this translation helpful? Give feedback.
All reactions