Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Problem building test assembly in 1.36b
ashmind
#1 Posted : Monday, December 19, 2011 9:23:44 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/19/2011(UTC)
Posts: 4
Location: Auckland

Was thanked: 1 time(s) in 1 post(s)
In previous versions, tests didn't run, but assembly was built successfully.
Now I am getting the error

(0): The target "CommonTestActions" does not exist in the project.

Thanks in advance.
Remco
#2 Posted : Monday, December 19, 2011 10:54:51 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting!

Do you have any custom build steps for your project? Or you making use of any SDKs or build frameworks?

It would be great if you could submit a bug report after your build error - this will help me to identify why this error is appearing.

Thanks!


Remco
ashmind
#3 Posted : Tuesday, December 20, 2011 1:55:23 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/19/2011(UTC)
Posts: 4
Location: Auckland

Was thanked: 1 time(s) in 1 post(s)
Hi,
I just remembered that CommonTestActions is my own custom target.
It is defined in a separate *.targets file (included in the same project as a <None /> item as well).
I tried adding it to the AdditionalFilesToInclude but it still does not build.

See bug report as well ("CommonTestActions problem").

Thanks,
Andrey

Remco
#4 Posted : Tuesday, December 20, 2011 3:33:57 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi Andrey,

Thanks for sending through the bug report. I've noticed quite a few references to the custom targets file and it looks as though it's going into the workspace, so I think this may be an issue with the build itself rather than the workspacing.

When your project fails to build, can you:

* Right click the component in the tests window
* Choose to browse to the workspace
* Check that the .targets file is in the correct place in the workspace, relative to the .csproj file
* Have a look at the .csproj file itself to see if its reference to the targets file looks correct
* Try running MSBuild directly against the .csproj file to see if it complains about this issue

This will help to give more information about why the build is failing for NCrunch but not in your IDE.


Cheers,

Remco
ashmind
#5 Posted : Tuesday, December 20, 2011 10:40:40 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/19/2011(UTC)
Posts: 4
Location: Auckland

Was thanked: 1 time(s) in 1 post(s)
Hi Remco,
I have found one issue with custom tasks not being included into AdditionalFilesToInclude.
After I did that, I tried MSbuild in the workspace dir, and it complained about:

"C:\Users\me\AppData\Local\NCrunch\4360\454\CodeFolder1\CodeFolder2\Tests\Tests.csproj" (default target) (1) ->
(ResolveTestReferences target) ->
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error : Could not load file or assembly 'MyReferencedAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

I have anonymized the message, but that assembly is produced by the project reference of a Tests.csproj.
On the other hand, while in MSBuild BeforeBuild runs correctly, in NCrunch it is still (0): The target "CommonTestActions" does not exist in the project.
Same happens after rebuild.

Thanks,
Andrey
Remco
#6 Posted : Wednesday, December 21, 2011 3:02:50 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
It's possible that the MSBuild error is because of the build being run out of sequence (which can happen if it's invoked via command line), though I find it strange the MSBuild and NCrunch would return a different result from the same build file, as they are both doing essentially the same thing. Does restarting your IDE after setting the AdditionalFilesToInclude setting make any difference to the results from NCrunch?

Considering your build customisations, you may want to have a look using $(NCrunch)=='1' for some steps in your build. This property is present (via environment variable) in every build process used by NCrunch, and it can be used to implement conditional build logic based on whether NCrunch is responsible for executing the build or not.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.046 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download