Xml file copy output directory
Copy to output directory not working as expected Ask Question. Asked 4 years, 6 months ago. Active 4 years, 6 months ago. Viewed 2k times. Improve this question. Chris Chris 11 4 4 bronze badges. Add a comment. Active Oldest Votes. Improve this answer.
Markus Markus We inherited this solution, it's set up in an odd way so there may be some other setting that is causing this.
According to the CMS vendor notes the file is required as part of a security patch. I spoke to other members in my team who implemented the patch elsewhere it appears it's not required.
One implementation has the file included in the published output and another doesn't but they both work correctly — Chris. I'm accepting this answer as I think it's a better solution than mine. With the new PackageReference it's in my opinion, better not to have any symbolic link appearing in Visual Studio Explorer to the file physically located in the Nuget cache.
I think there is no template for target files! They are common xml files. Here are some examples. The ProjectName. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.
Linked Related 3. Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled. Accept all cookies Customize settings. I've included this file in the test project, and have the file set to 'content' and 'always copy to output directory'. When I execute the tests, however, the xml file is not there.
The file hasn't been copied there. Is there a way to force this file to copy, or do I need to fully qualify the reference from within the test? Update I set the DeploymentItem attribute, but the file still doesn't copy. But that sure looks like what I want I ran SysInternals' Process Monitor, to see where it was looking for my xml file. Here's what I found:. Visual studio created a temporary working directory for the tests, but there was only one file in it, AgentRestart.
When I ran the tests using the 'Run Unit Tests' button in my toolbar not sure what test option that is , Visual Studio did not copy the file over, but referenced it directly from the project directory.
The test passed, and no temporary working directory was created. The test passed. When I edited Local. I removed the DeploymentItem attribute. Now I was able to debug the tests; the xml file and all executables were copied to the temporary directory created for the test.
The solution is to edit Local. Thanks for the help! I'm giving CPedros credit for his answer, as it was the most helpful in resolving this. I've been wrestling with deploymentattribute for a while now, and have finally just given up. Instead I'm just manually copying my files over to a test directory and then deleting them once finished:. I was facing the issue like, one of my file was not getting copied in to out folder even if i have entered that file name in local.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Xml file not copying to test output directory Ask Question. Asked 11 years, 1 month ago.
0コメント