-
Notifications
You must be signed in to change notification settings - Fork 255
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
Build error when one test project references another #3813
Comments
Hi @bdukes Are you expecting to run tests from |
I'm expecting to run tests from both |
I can reproduce the issue, I need a few more tests and investigation to suggest the proper fix. |
I'm also seeing this issue. In my case, we have various test helper projects referenced by our test projects. We do also have a few test projects referencing each other, but it's primarily an issue with test helpers. |
@jbcutting we do recommend to have test helper libraries as libraries and not executable. |
They are libraries. We're not using executables for any of our test projects currently. We're still on MSTest 3.0.4 currently because I've run into something each time I've tried to update. I was hoping 3.6 would be my upgrade point, but I'm now waiting for 3.7 due to this. Is there a way to avoid this with test helpers if I override a setting in 3.6? If I avoid exe test outputs altogether, would it bypass this issue? |
Fix will be ported to 3.6.1. For your case, you don't even need the fix. In 3.6+ detecting if the project is library or application (through the If you are using If you are not using I hope this helps. |
This issue is not resolved if you have two projects and internalsvisible used to reuse an internal class. |
Upgrading to 3.6.1 resolved my issue, thanks @Evangelink! |
I'll run a few more tests. @MarcoK80 I'd like to discuss a little more about your scenario. I am still not fully sold on the idea of having an exe referencing an exe. |
@Evangelink I think it should not necessarily be two executables. I have two libraries where one has "internalsvisible" to the other and the issue is reproducible. Update |
Describe the bug
Starting with MSTest 3.6.0, when one test project references another test project, warning CS0436 is emitted by the compiler because the same type is being compiled into two assemblies.
Steps To Reproduce
build-error-on-reference
branch from bdukes/mstest-demodotnet build
Expected behavior
The build command is successful.
Actual behavior
The build command fails with the following error:
The text was updated successfully, but these errors were encountered: