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

Notification

Icon
Error

Problems with Microsoft.TextTemplating.targets
sjkirk
#1 Posted : Thursday, October 13, 2016 8:35:04 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/23/2015(UTC)
Posts: 9
Location: United Kingdom

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
At GitHub we'd like to use NCrunch on our GitHub for Visual Studio extension. However, we use T4 templates in some of our projects, which is causing a problem.

You can see the problem at https://github.com/github/VisualStudio/ on the grokys/ncrunch branch. I'm getting the following error:

Code:

..\..\lib\Microsoft.TextTemplating.targets (396, 5): An Exception was thrown while running the transformation code. The process cannot continue.  The following Exception was thrown:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at Microsoft.VisualStudio.TextTemplating.CompilerBridge..ctor(String source, Boolean debug, IEnumerable`1 references, String cmdLineArguments)


I've added the Microsoft.CodeAnalysis.dll file to the lib directory, and included the lib directory as additional files in NCrunch, but no joy. Any ideas?
Remco
#2 Posted : Thursday, October 13, 2016 10:06:45 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for posting!

This particular build targets takes a range of properties as input, including what appears to be lists of assembly references. I don't think it was designed with NCrunch's workspacing in mind; possibly it assumes that referenced assemblies are co-located with the project being built.

I'd recommend trying NCrunch in compatibility mode to see if there is a setting that works around the problem.

It may be necessary to disable this build target to allow NCrunch to work for your projects. You can do this by adding conditional logic to your build to prevent certain parts of it from being executed by NCrunch. This could be done with a condition on the target itself, or alternatively on the <Import> statement used to include the .targets file inside the build.
sjkirk
#3 Posted : Thursday, October 13, 2016 6:50:57 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/23/2015(UTC)
Posts: 9
Location: United Kingdom

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Thanks Remco, disabling the target using a conditional solved this for me. I stumbled upon another problem, but I'll start a new thread for that as it's unrelated.
1 user thanked sjkirk for this useful post.
Remco on 10/13/2016(UTC)
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.025 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download