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

Resource folder "en" is deleted #197

Closed
sheitmann opened this issue Jun 9, 2017 · 7 comments
Closed

Resource folder "en" is deleted #197

sheitmann opened this issue Jun 9, 2017 · 7 comments
Labels
Help-Wanted The issue is up-for-grabs, and can be claimed by commenting Type: Bug

Comments

@sheitmann
Copy link

Hi,

I have a shared output directory for my library assemblies and my test assemblies.
After adding a project using MSTestV2 I noticed that my "en" resource folder is deleted when the unit test project is created. This caused some tests to fail because the resources where not there anymore.
After some investigation I found the msbuild property to disable that behavior: EnableMSTestV2CopyResources
If it is activated (default is true) it is cleaning up some resources and deletes the whole folder.

My question is, what is this used for at all and what does that mean for me now that I have disabled it?
Is a good idea to delete the whole resources directory because of side effects?

Br
Sven

@AbhitejJohn
Copy link
Contributor

@shietmann: We use this to ensure that failure/warning messages from the adapter are localized for non en languages. This msbuild task copies over Framework/Adapter resources over to the Out directory and ensures they are cleaned up on Clean. Its strange that a project creation is deleting that folder. Is this dotnet new? If this is a project build on the other hand, can you share the msbuild logs with us please?

P.S: You have the right workaround for now and this should not impact you as long as you are running against en.

@sheitmann
Copy link
Author

sheitmann commented Jun 14, 2017

@AbhitejJohn
thanks for your answer
the problem is doing a rebuild inside of visual studio
each project runs a clean before build and so all resources files in the en folder which were built before the test project are deleted.

doing a simple build in visual studio is working fine.

@AbhitejJohn
Copy link
Contributor

@sheitmann : Got it. This should be a bug.
To give you context here is the code that does it. We added that piece because build was not cleaning up empty folders. We either need to add in logic to clean conditionally or not clean at all and leave the empty folders as is.

@pvlakshm pvlakshm added the Help-Wanted The issue is up-for-grabs, and can be claimed by commenting label Nov 2, 2017
@ShreyasRmsft
Copy link
Member

Add a conditional clean to the csproj.

@jayaranigarg
Copy link
Member

@sheitmann : Can you please provide us with a small repro for your problem?

@sheitmann
Copy link
Author

sheitmann commented May 23, 2018

@jayaranigarg
I have attached a small project. TestIssueRepo.zip
The important part is that all projects share the same output directory.

If you do a "rebuild solution" you will see that the en folder with the resource assemblies is missing.
The tests will fail.

If you do a "clean solution" and a "build solution" the en folder is still there and the tests will succeed.

When not sharing the same output directory it is working fine.

@jayaranigarg
Copy link
Member

jayaranigarg commented May 24, 2018

@sheitmann : Thank you for the repro. We have fixed the issue on our end. You can consume the fix from here :
https://dotnet.myget.org/feed/mstestv2/package/nuget/MSTest.TestAdapter/1.3.0-build-20180524-02
https://dotnet.myget.org/feed/mstestv2/package/nuget/MSTest.TestFramework/1.3.0-build-20180524-02

singhsarab pushed a commit to singhsarab/testfx that referenced this issue Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help-Wanted The issue is up-for-grabs, and can be claimed by commenting Type: Bug
Projects
None yet
Development

No branches or pull requests

5 participants