Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Template runs as part of the target solution but does not run as part of a Guidance Package
 

Template runs as part of the target solution but does not run as part of a Guidance Package

Hi

I want to use custom libraryin my t4 template

<#@templatelanguage="C#"#>
<#@assemblyname="Custom"#>
<#@ import namespace = "CustomNamespace">

I registered Custom.dll in GAC
Thensimply added template as .tt file in VS project
After pressing Saveit works fine, generating the output

Then i includedthis template into existing Guidance Package asCustomTemplate.cs.t4 file

<Action Name="CustomAction" Type="TextTemplateAction" Template="CustomTemplate.cs.t4">
...
</Action>

And this action in the Guidance Package recipe runs with error:

Error: Compiling transformation: Metadata file 'Custom' could not be found

So how can i provide access to my custom.dll from the template which runs from Guidance Package ?

Thank you for advance
  • Edited byhamanu Wednesday, September 17, 2008 8:14 PM
  •  
hamanu  Wednesday, September 17, 2008 7:52 PM
Hi Hamanu,

When you say "after pressing save" I'm guessing that you're using a Vs2008 custom tool to generate the template if so, in that case you're using the VisualStudio host which can resolve the assemblies from the GAC, but when you run a template from an action or any other place but in the context of GAX, you're using the GAX host, which use some particular folders to resolve the assemblies.

Those dirs are:
- GP Private Bin where the configuration file is located,
- Vs PublicAssemblies
- Vs PrivateAssemblies

hth
jose.

Jose Escrich - weblogs.asp.net/jescrich
  • Edited byJose Escrich Wednesday, September 17, 2008 9:59 PM
  • Proposed As Answer byJose Escrich Wednesday, September 17, 2008 9:59 PM
  •  
Jose Escrich  Wednesday, September 17, 2008 9:58 PM
Thank you, i will try
By the way, GP Private BIN - is this <GP Source>/Bin/Debug folder where compiled GP lies ?
hamanu  Thursday, September 18, 2008 4:59 AM

You can use google to search for other answers

Custom Search

More Threads

• System.Web.Extensions
• Installing Guidance package for both VS2005 and VS2008
• Deploy referenced assemblies with a guidance package
• GAT and DSL
• Debugging your packages.
• Effort in creating class recipe
• Can't install GAT on VS2008
• How to add files to a solution folder?
• SiteMap Navagation getting covered up
• Argument of ValueProvider is only Replaced if I put it on the WizardForm