Welcome Guest Search | Active Topics | Members | Log In | Register

T4 and SMO Options · View
Johan Karlsson
Posted: Wednesday, May 07, 2008 1:50:29 PM


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)

Johan Karlsson
Posted: Wednesday, May 07, 2008 1:59:50 PM


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)
>

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.

Main Forum RSS : RSS

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.1 (NET v2.0) - 9/10/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.039 seconds.