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

Notification

Icon
Error

The OutputPath property is not set for project
AnthonyMastrean
#1 Posted : Monday, May 16, 2011 10:29:20 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/16/2011(UTC)
Posts: 7
Location: Pittsburgh, PA, USA

I just installed NCrunch, opened a solution, and clicked NCrunch > Tests. I see red Xs on all my projects and the message on each one is

Quote:
Errors occurred while trying to load the project file:
The OutputPath property is not set for project 'nCrunchTemp_ce08f292-c66a-4bc2-870b-a19c3ba1d9b2'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='DEBUG' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.


My solution's default configuration is 'DEBUG', but my Platform is 'x64' due to certain technical reasons. How do I fix the temp NCrunch property platform?
Remco
#2 Posted : Tuesday, May 17, 2011 6:24:42 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 818 times
Was thanked: 1095 time(s) in 1038 post(s)
This is quite a common error often seen when the projects within your solution can't be built independently using MSBuild.

You should in theory be able to replicate the error outside of NCrunch by building your .proj files directly using MSBuild on the command line.

Make sure each of your .proj files has a default configuration specified in a PropertyGroup, for example: <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

You can also specify the $(Configuration) variable in the NCrunch configuration for each component (try setting 'UseBuildConfiguration' to DEBUG), though this is a bit of a dirty way of getting around the problem.

AnthonyMastrean
#3 Posted : Tuesday, May 17, 2011 12:38:15 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/16/2011(UTC)
Posts: 7
Location: Pittsburgh, PA, USA

Every one of my projects has one PropertyGroup with the configuration and platform like this

Quote:
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Remco
#4 Posted : Tuesday, May 17, 2011 7:04:48 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 818 times
Was thanked: 1095 time(s) in 1038 post(s)
Interesting. Do the projects build on their own outside the solution? If not - hit the Bug Report button and I'll take a look at the log file.
AnthonyMastrean
#5 Posted : Tuesday, May 17, 2011 7:26:58 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/16/2011(UTC)
Posts: 7
Location: Pittsburgh, PA, USA

I do have a .targets file in my Solution Items (and physically, at my solution root) that my projects import for various common tasks. Could that be a problem? The projects reference them by $(SolutionDir)...

Quote:
<Import Project="$(SolutionDir)\Build.targets" />



Did I notice something in the docs for NCrunch that say project relative refs are better?
Remco
#6 Posted : Tuesday, May 17, 2011 8:22:54 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 818 times
Was thanked: 1095 time(s) in 1038 post(s)
I'd say that this is definitely likely to cause you problems. Try adjusting this to be a path relative to the project file you're building, and see if this helps.

You may also need to use the AdditionalFilesToInclude option to make sure the imported build script is found by NCrunch and copied to the workspace. NCrunch is usually pretty good with working out these sorts of dependencies, but imported MSBuild scripts can give it trouble if you're using MSBuild variables to describe their paths.
AnthonyMastrean
#7 Posted : Wednesday, May 18, 2011 6:54:23 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/16/2011(UTC)
Posts: 7
Location: Pittsburgh, PA, USA

Because of various native dependencies my solution only supports the x64 platform. I went through my .csproj files and edited the XML directly. I made sure that each of my projects had defaults of

Quote:
Debug|x64


and that each project specified possible configurations of

Quote:
Debug|x64
Release|x64


After this, NCrunch Tests showed each of my projects in progress (the clock icon). The NCrunch Processing Queue showed all but one of go to the ? state (they depend on the remaining project). And the final project had a red X and a new error message...

Quote:
[14:45:54.2581-BuildTask-234] Error 'Compilation': Omnyx.Scanner: Bootstrap\MacroCameraRegistry.cs (10): The type or namespace name 'MacroSegmentationCLI' could not be found (are you missing a using directive or an assembly reference?)


The project that failed to compile has a project reference to this managed C++ project and uses types from it.

Quote:
using MacroSegmentationCLI;


I tried including the MacroSegmentationCLI DLL. I tried including the requirements of that CLI project (two lib files). That made no difference. There's nothing special about this particular library project (it doesn't have any $(SolutionDir) tasks in it's .csproj file like the others that I mentioned earlier).
AnthonyMastrean
#8 Posted : Wednesday, May 18, 2011 7:30:29 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/16/2011(UTC)
Posts: 7
Location: Pittsburgh, PA, USA

Ok, I've decided to try your initial advice and build the project from msbuild... I'll be chronicling my success and failure

Quote:
x:\proj-dir> msbuild
AnthonyMastrean
#9 Posted : Wednesday, May 18, 2011 7:55:14 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/16/2011(UTC)
Posts: 7
Location: Pittsburgh, PA, USA

It's going to be easier for me to post if I use the real project names. I'm building Omnyx.Scanner from it's project directory and I'm going to try to solve all the resulting problems...

Quote:
x:\Omnyx.Scanner> msbuild


The first thing that fails is the CLI project dependency.

Quote:
x:\MacroSegmentationCLI\MacroSegmentationCLI.vcxproj(3,3): error MSB4019: The imported project "D:\Native.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.


MSBuild cannot even load the project because there is an import at the top of the file that uses $(SolutionDir). Native.targets provides some build output paths and tasks for the native projects... it's located two directories up, at the solution root.

Quote:
<Import Project="$(SolutionDir)\Native.targets" />


That project depended on another native project with the same import. I changed them both to use a relative path and msbuild got past that error.

Quote:
<Import Project="..\..\Native.targets" />


However, now it's complaining about a configuration/platform combination of Debug|Win32...

Quote:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(283,5): error MSB8013: This project doesn't contain the Configuration and Platform combination of Debug|Win32. [x:\MacroSegmentation\MacroSegmentation.vcxproj]


I'm not using that platform anywhere! Is this an msbuild default? These projects also only specify Debug and Release|x64. (bonus: NCrunch is now reporting the same error)



Bonus info: If I override the msbuild command, providing the platform switch, the single project builds. I feel that if I can overcome this default platform, I could get NCrunch to work.

Quote:
x:\Omnyx.Scanner> msbuild /property:Platform="x64"
Remco
#10 Posted : Thursday, May 19, 2011 6:28:19 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 818 times
Was thanked: 1095 time(s) in 1038 post(s)
Nice going. Try introducing the Platform property as a element of an unconditional PropertyGroup inside the build script. This will be effectively the same as injecting it through the command line, and it should work with NCrunch.
AnthonyMastrean
#11 Posted : Thursday, May 19, 2011 6:46:29 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/16/2011(UTC)
Posts: 7
Location: Pittsburgh, PA, USA

I entered a conditionless property group specifying the x64 platform and had to include some files using the NCrunch additional files and it actually compiled the project! However... it was not able to find the LIB output of this managed C++ project... I submitted a bug report.

Quote:
(0): Unable to find built assembly. Checked locations: C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\bin\debug\nCrunchTemp_93489230-2a9d-4a62-802b-144bb63ca44b.dll
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\bin\debug\nCrunchTemp_93489230-2a9d-4a62-802b-144bb63ca44b.exe
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\bin\debug\MacroSegmentation.dll
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\bin\debug\MacroSegmentation.exe
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\bin\nCrunchTemp_93489230-2a9d-4a62-802b-144bb63ca44b.dll
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\bin\nCrunchTemp_93489230-2a9d-4a62-802b-144bb63ca44b.exe
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\bin\MacroSegmentation.dll
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\bin\MacroSegmentation.exe
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\debug\nCrunchTemp_93489230-2a9d-4a62-802b-144bb63ca44b.dll
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\debug\nCrunchTemp_93489230-2a9d-4a62-802b-144bb63ca44b.exe
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\debug\MacroSegmentation.dll
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\debug\MacroSegmentation.exe
D:\code\ScannerSoftware\Trunk\Scanner\MacroSegmentation\..\..\x64\Debug\nCrunchTemp_93489230-2a9d-4a62-802b-144bb63ca44b.dll
D:\code\ScannerSoftware\Trunk\Scanner\MacroSegmentation\..\..\x64\Debug\nCrunchTemp_93489230-2a9d-4a62-802b-144bb63ca44b.exe
D:\code\ScannerSoftware\Trunk\Scanner\MacroSegmentation\..\..\x64\Debug\MacroSegmentation.dll
D:\code\ScannerSoftware\Trunk\Scanner\MacroSegmentation\..\..\x64\Debug\MacroSegmentation.exe
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\.\nCrunchTemp_93489230-2a9d-4a62-802b-144bb63ca44b.dll
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\.\nCrunchTemp_93489230-2a9d-4a62-802b-144bb63ca44b.exe
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\.\MacroSegmentation.dll
C:\Users\anthony.mastrean\AppData\Local\NCrunch\8288\2\x\x\.\MacroSegmentation.exe
Remco
#12 Posted : Thursday, May 19, 2011 6:56:05 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 818 times
Was thanked: 1095 time(s) in 1038 post(s)
Thanks! Will take a look.
Remco
#13 Posted : Monday, May 23, 2011 5:04:12 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 818 times
Was thanked: 1095 time(s) in 1038 post(s)
Hi Andrew,

Thanks for sending through the log file. I can reproduce this problem consistently and can confirm that NCrunch has a compatibility issue with static libraries shared between projects.

So far, NCrunch's support for C++ projects has been shallow and is quite limited. I do have some plans to extend better support in this area, although the build behaviour around C++ projects is quite different to other .NET projects and some effort will be required before I can safely warrant that NCrunch will support these projects consistently in a range of different environments.

1.31b (due for release this week) contains a fix that will allow NCrunch to find the lib file, but usage of the file by other projects within the solution is so far impossible. The best option I can provide you with would be to separate the build of your C++ projects into a different solution, then introduce direct DLL assembly references from your other projects to the build outputs from this solution. Better C++ support should be added in a future release several months from now.


Cheers,

Remco
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.251 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download