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

Notification

Icon
Error

blc303
#1 Posted : Saturday, January 14, 2012 8:04:20 PM(UTC)
blc303
Rank: Newbie

Groups: Member
Joined: 1/14/2012(UTC)
Posts: 1
Location: Dortmund

Hi,

I am trying to generate a T4 for a DSL from the Visual Modelling SDK.

You answered a similar question once but I seem to be having some futher difficulties.

If I add the dsl dll as an assembly (<@ assembly name="my dsl assembly" @>), I get intellisense for the dsl objects. The problem is that I can't run the .tt file because I get the error

Quote:
Error 3 Compiling transformation: An assembly with the same identity 'Company.TransCTest.Dsl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2db13597bb475c7' has already been imported. Try removing one of the duplicate references. D:\Users\bla\Documents\Visual Studio 2010\Projects\Tests\DSL\TransCTest\Debugging\TransCTestReport.tt


Is there a workaround for this? Note: I am editing the .tt in my debugging window and the assembly is automatically used, not referenced directly as a dll. Am I missing something?

Thanks

Ben.
tangible|Björn
#2 Posted : Sunday, March 18, 2012 10:42:32 PM(UTC)
tangible|Björn
Rank: Administration

Groups: Administration
Joined: 3/17/2009(UTC)
Posts: 168
Man
Germany

Was thanked: 12 time(s) in 12 post(s)
Hi Ben,

i think the problem is that the DSL.dll is loaded from another location. In case of VS 2010 please do not specify the location of the assembly,
if you are running VS in Exp mode and are debugging the dsl.

E.g:

<#@ template inherits="Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation" #>
<#@ output extension=".txt" #>
<#@ assembly name="Microsoft.VisualStudio.TextTemplating.Modeling.10.0.dll"#>
<#@ MyOwnDSL processor="MyOwnDSLDirectiveProcessor" requires="fileName='Sample.mydsl1'" #>
<#@ assembly name="Company.MyOwnDSL.Dsl.dll"#>
<#@ import namespace="Company.MyOwnDSL"#>
<#@ import namespace="Microsoft.VisualStudio.Modeling" #>
<#@ import namespace="System.Collections.Generic" #>

Generated material. Generating code in C#.

<#

// When you change the DSL Definition, some of the code below may not work.

foreach (ExampleElement element in this.ExampleModel.Elements)
{
#>
<#= element.Name #>
<#
}
#>

If you using a DSL someone else created the best you can do is add it to the GAC or install it as VSIX to your extensions folder.
tangible
#3 Posted : Sunday, March 18, 2012 11:33:42 PM(UTC)
Guest
Rank: Guest

Groups: Guest
Joined: 3/17/2009(UTC)
Posts: 1,084

Hi all,

I did some more research and found out that the error listed above occurs when the DSL.dll is loaded from a wrong location. The default location in Exp Hive of your DSL looks similar like this:

<#@ assembly name="C:\Users\Tim Fischer\AppData\Local\Microsoft\VisualStudio\10.0Exp\Extensions\Company\MyOwnDSL\1.0.0.0\Company.MyOwnDSL.Dsl.dll"#>

Eventually it will also work without any path for you, depending on the packagedef file and installation options for your DSL.

I hope this helps

Tim



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.

Powered by YAF | YAF © 2003-2020, Yet Another Forum.NET
This page was generated in 0.389 seconds.

Authorization on the site

For an authorized user opens up new possibilities

Login

Password