
 Rank: Guest Groups: Guest
Joined: 9/17/2007 Posts: 11,670 Points: -1,200
|
Date parsed: 07/05/2008 13:50:29 Date: Wed, 7 May 2008 11:50:29 +0200
Hi!
I'm having trouble to get a reference working when generating code with T4. I'm using Visual Studio 2008 Team Developer Edition. I can reference the assemblies in a testproject and create Server and Database objects with no problem.
The template is the following code
<#@ template language="VB" #> <#@ output extension=".vb" #> <#@ assembly name="Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" #> <#@ assembly name="Microsoft.SqlServer.ConnectionInfo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" #> <#@ import namespace="Microsoft.SqlServer.Management.Smo" #> <#@ import namespace="System.IO" #> <#@ import namespace="System" #>
Public Class Test Public Sub HelloWorld Msgbox("Hello") End Sub End Class
and the error is
ErrorGeneratingOutput Error: Compiling transformation: could not find library 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' (0, 0) Error: Compiling transformation: compiler initialization failed unexpectedly: 0x80070002 (0, 0)
|

 Rank: Guest Groups: Guest
Joined: 9/17/2007 Posts: 11,670 Points: -1,200
|
Date parsed: 07/05/2008 13:59:50 Date: Wed, 7 May 2008 11:59:50 +0200
Additional info,
It seems to be the T4 Editor preview function that isn't working. The code is generated correctly.
// Johan
"Johan Karlsson" <johan.kson@gmail.com> wrote in message news:A86159FD-2B02-46CF-884B-1E6C63E03F44@microsoft.com... > Hi! > > I'm having trouble to get a reference working when generating code with > T4. I'm using Visual Studio 2008 Team Developer Edition. I can reference > the assemblies in a testproject and create Server and Database objects > with no problem. > > The template is the following code > > <#@ template language="VB" #> > <#@ output extension=".vb" #> > <#@ assembly name="Microsoft.SqlServer.Smo, Version=9.0.242.0, > Culture=neutral, PublicKeyToken=89845dcd8080cc91" #> > <#@ assembly name="Microsoft.SqlServer.ConnectionInfo, Version=9.0.242.0, > Culture=neutral, PublicKeyToken=89845dcd8080cc91" #> > <#@ import namespace="Microsoft.SqlServer.Management.Smo" #> > <#@ import namespace="System.IO" #> > <#@ import namespace="System" #> > > Public Class Test > Public Sub HelloWorld > Msgbox("Hello") > End Sub > End Class > > and the error is > > ErrorGeneratingOutput > Error: Compiling transformation: could not find library > 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, > PublicKeyToken=89845dcd8080cc91' (0, 0) > Error: Compiling transformation: compiler initialization failed > unexpectedly: 0x80070002 (0, 0) >
|