I am using the Visualization and Modeling SDK to automatically regenerate my T4 templates on build. The T4 template I have reads my EDMX file and automatically generates an In-memory Stub version of my database.
It appears that NCrunch has an issue with that, reporting build failure.
It doesn't appear to be an issue with loading the custom build target, itself. Rather, it appears only when I turn on <TransformOnBuild>true</TransformOnBuild>, and it reports that it cannot find my EDMX file.
Should I somehow re-structure this? Or would it be feasible for NCrunch to do its builds with all files in the same layout as the original solution?
Build/Test Issues
NCrunch cannot build my tests project, since it relies on the models project to generate a stub.
Started by otac0n on 9,663 views
Remco NCrunch Developer
#125
23 May 2011 17:20 UTC
It's quite possible that in using this SDK you've come across an MSBuild item type that NCrunch doesn't know about.
Can you try adding the missing file using AdditionalFilesToInclude setting in the project's configuration? This is a simple workaround that would help NCrunch to find it.
If you can open up the .proj file containing the file, would you be able to send through to me the MSBuild scripting that describes the file being included? For example:
<ItemGroup>
<ClInclude Include="ClrCpp.h" /> <-------- this line
</ItemGroup>
.. In this way I should be able to fix the issue properly in a future release.
If this doesn't do the trick, please punch through a bug report and I'll take a look at the build log.
Can you try adding the missing file using AdditionalFilesToInclude setting in the project's configuration? This is a simple workaround that would help NCrunch to find it.
If you can open up the .proj file containing the file, would you be able to send through to me the MSBuild scripting that describes the file being included? For example:
<ItemGroup>
<ClInclude Include="ClrCpp.h" /> <-------- this line
</ItemGroup>
.. In this way I should be able to fix the issue properly in a future release.
If this doesn't do the trick, please punch through a bug report and I'll take a look at the build log.
Edited 23 May 2011 17:23 UTC
Well, NCrunch seems to be handling the MSBuild stuff just fine.
The issue is that NCrunch isn't keeping the whole solution structure consistent, just the individual projects. I'm sure there is a reason it is done that way, but my particular template relies on cross-compiling, basically.
I have already pushed a bug report, so that you have the build log.
However, for a simplified example, imagine this:
2 projects, ProjectA and ProjectB.
The solution has this structure:
ProjectB has the following post build step (overwriting its File2 with ProjectA's File1):
The post build step would fail (under NCrunch) because there is no "ProjectA" directory from which to pull.
The issue is that NCrunch isn't keeping the whole solution structure consistent, just the individual projects. I'm sure there is a reason it is done that way, but my particular template relies on cross-compiling, basically.
I have already pushed a bug report, so that you have the build log.
However, for a simplified example, imagine this:
2 projects, ProjectA and ProjectB.
The solution has this structure:
Solution.sln
ProjectA\ProjectA.csproj
ProjectA\File1.txt
ProjectB\ProjectB.csproj
ProjectB\File2.csProjectB has the following post build step (overwriting its File2 with ProjectA's File1):
copy ..\ProjectA\File1.txt File2.csThe post build step would fail (under NCrunch) because there is no "ProjectA" directory from which to pull.
Edited 26 May 2011 01:35 UTC
Remco NCrunch Developer
#174
26 May 2011 05:45 UTC
Yes, that is correct.
NCrunch will pull projects out of the solution and build/test them independently from each other. This means that for the system to work correctly, it needs to be possible for your projects to work in isolation.
There are tricks that you can use, such as the AdditionalFilesToInclude setting that allow you to import files from other projects, by claiming that they are part of the project being built. In your case, I think this could work for you in the example you've shown above. When building ProjectB, you could specify "..\ProjectA\File1.txt" as an additional file to include, then turn on the post build event for that project.
I haven't yet come across a project/solution arrangement where it was impossible to make it work like this. I would say though that the amount of effort involved will depend upon how modular your system is and how heavily you have customised the build process.
NCrunch will pull projects out of the solution and build/test them independently from each other. This means that for the system to work correctly, it needs to be possible for your projects to work in isolation.
There are tricks that you can use, such as the AdditionalFilesToInclude setting that allow you to import files from other projects, by claiming that they are part of the project being built. In your case, I think this could work for you in the example you've shown above. When building ProjectB, you could specify "..\ProjectA\File1.txt" as an additional file to include, then turn on the post build event for that project.
I haven't yet come across a project/solution arrangement where it was impossible to make it work like this. I would say though that the amount of effort involved will depend upon how modular your system is and how heavily you have customised the build process.
Is AdditionalFilesToInclude an NCrunch thing or are you re-using an existing mechanism?
Edited 26 May 2011 13:47 UTC
Remco NCrunch Developer
#177
26 May 2011 22:15 UTC
It's an NCrunch thing. Because NCrunch needs to pull the entire project out of your working solution and into a workspace, it needs to know which files are required for the project to build/run.
The primary way it handles this is by pulling file references from the .proj file. For everything else you need in the NCrunch workspace, there's AdditionalFilesToInclude :)
The primary way it handles this is by pulling file references from the .proj file. For everything else you need in the NCrunch workspace, there's AdditionalFilesToInclude :)
Post a reply
Log in to reply.