Can't debug unit tests

I am not able to debug unit tests.

when I Select 'Debug Unit test' either by selecting one unit test in the gutter or right clicking on the project I get the followint message box:

ReSharper Unit Test Runner could not find a suitable startup project.
Please select a debuggable project in your solution as the startup project.

My selected Startup Project is debuggable, meaning I Debug infomation is generated for it and it creates an .exe file. Are there any other reqirements for a debuggable startup project?

Thanks
Thomas

11 comments
Comment actions Permalink

Hello Thomas,

could you please elaborate on what kind of a project is your startup project?
Just having a debug information is not enough,
there should be a possibility to provide an external application (Unit Test
Runner) for debugging (see e.g. a Class Library project).
Some projects such as Web Sites don't meet this requirement, and you have
to choose another debugging method (ReSharper|Options|Unit testing)
for them.


Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I am not able to debug unit tests.

when I Select 'Debug Unit test' either by selecting one unit test in
the gutter or right clicking on the project I get the followint
message box:

ReSharper Unit Test Runner could not find a suitable startup project.
Please select a debuggable project in your solution as the startup
project.

My selected Startup Project is debuggable, meaning I Debug infomation
is generated for it and it creates an .exe file. Are there any other
reqirements for a debuggable startup project?

Thanks
Thomas



0
Comment actions Permalink

I have the same problem. I use two projects MyProject of type Windows Application and MyProjectTest of Type ClassLibrary (tests are here). I can debug only if Debugging Method is Attach to the running process. Other Debugging Method options leads to same message "ReSharper Unit Test Runner could not find...". Even then I put tests into MyProject it does not work. I have read help but it did not help to me. How and when to use other debugging methods?

0
Comment actions Permalink

Hi,

My StartupProject is an .exe. And after switching to the Debugging Methode to Attach to the running process it worked.

A short documentation on which StartupProjectType is supported by the Debugging methode would be nice.

Thanks,
Thomas

0
Comment actions Permalink

I've recently started having this same problem after I did some reorganization of my solution files. I found that I cannot specify any project in a subfolder/solution folder as the debug startup project.

In my case, my entire solution is all class libraries with the unit tests in a separate folder. Such as the following:

\MySolution
\MySolution\ClassLibrary1
\MySolution\ClassLibrary2
\MySolution\UnitTests
\MySolution\UnitTests\ClassLibrary1Tests
\MySolution\UnitTests\ClassLibrary2Tests

The resharper logs show error messages such as "Could not find project \UnitTests\ClassLibrary1Tests\ClassLibrary1Tests.csproj"

Setting the startup project to one of the root level projects did allow me to debug.

Hopefully this helps narrow things down a bit.

-Shawn

0
Comment actions Permalink

Hello Shawn,

thanks a lot for this information, we'll check it ASAP.


Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I've recently started having this same problem after I did some
reorganization of my solution files. I found that I cannot specify
any project in a subfolder/solution folder as the debug startup
project.

In my case, my entire solution is all class libraries with the unit
tests in a separate folder. Such as the following:

\MySolution
\MySolution\ClassLibrary1
\MySolution\ClassLibrary2
\MySolution\UnitTests
\MySolution\UnitTests\ClassLibrary1Tests
\MySolution\UnitTests\ClassLibrary2Tests
The resharper logs show error messages such as "Could not find project
\UnitTests\ClassLibrary1Tests\ClassLibrary1Tests.csproj"

Setting the startup project to one of the root level projects did
allow me to debug.

Hopefully this helps narrow things down a bit.

-Shawn



0
Comment actions Permalink

Hi,

I have encountered with a similar problem:

I used to have to different solutions which each one of them had its own unit test project and it worked just fine.

Now, I combined these two solutions into one using a Solution Folder to separate them one from each other. meaning I have a solution with two Solution Folder that each folder contains the project related to this "sub" solution.

when trying to run debug the unit tests, I get the same message:
"ReSharper Unit Test Runner could not find a suitable startup project.
Please select a debuggable project in your solution as the startup project."

note: when running the tests with out debugging it, it works just fine.

can you please help me solving this problem

Regards
ido

0
Comment actions Permalink

Hello inadler,

what ReSharper build you're using?

Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


Hi,

I have encountered with a similar problem:

I used to have to different solutions which each one of them had its
own unit test project and it worked just fine.

Now, I combined these two solutions into one using a Solution Folder
to separate them one from each other. meaning I have a solution with
two Solution Folder that each folder contains the project related to
this "sub" solution.

when trying to run debug the unit tests, I get the same message:
"ReSharper Unit Test Runner could not find a suitable startup project.
Please select a debuggable project in your solution as the startup
project."

note: when running the tests with out debugging it, it works just
fine.

can you please help me solving this problem

Regards
ido



0
Comment actions Permalink

ReSharper 2.0.259.14

0
Comment actions Permalink

Hello inadler,

I'd recommend that you upgrade to a newer version. This problem must have
been solved a long time ago, already in 2.5 version.


Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


ReSharper 2.0.259.14



0
Comment actions Permalink

Thanks
I will try it..

0
Comment actions Permalink

Upgrading to version 3 solved the problem.

Thanks

0

Please sign in to leave a comment.