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

System.IO.FileNotFoundException: No test is available in <myassembly.dll> when run from TFS #12

Closed
DominicBurford opened this issue Mar 23, 2018 · 5 comments

Comments

@DominicBurford
Copy link

I am getting the error

"System.IO.FileNotFoundException: No test is available in <myassembly.dll>. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate and try again."

...when running a batch script from TFS that executes coverlet.

I have added a reference to the "Microsoft.NET.Test.Sdk" assembly to my project (it is added by default by Visual Studio).

My project is ASP.NET Core 2.0 Razor Pages
Visual Studio 2017 15.3
MSBUILD 15
Team Foundation Services 2015

It runs without any errors when executed directly from the build server from the command-line. The error only occurs when executed from our TFS build.

@tonerdo
Copy link
Collaborator

tonerdo commented Mar 23, 2018

Can you try executing the tests from TFS build with coverage disabled? I ask because this doesn't seem like a coverlet issue

@DominicBurford
Copy link
Author

I don't have code coverage enabled as we don't have the Enterprise version. I'm not using any of the TFS test tasks as I'm using dotnet test for all our .NET Core testing requirements including code coverage.

@DominicBurford
Copy link
Author

I have managed to get this working.

If running coverlet from inside TFS you need to explicitly specify the project and suppress it from doing a build and restore.

For example

dotnet test "Project.Tests.csproj" --no-build --no-restore /p:CollectCoverage=true

@tonerdo
Copy link
Collaborator

tonerdo commented Mar 23, 2018

Hmmm...that's very weird. @OneCyrus seemed to have gotten it working without any hassles. See #5

@DominicBurford
Copy link
Author

DominicBurford commented Mar 23, 2018

Possibly TFS doesn't have access to the same environment as when executed from the command-line. But there's a perfectly valid workaround so this issue may be closed.

@tonerdo tonerdo closed this as completed Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants