 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.
|
|
|
|
 Rank: Administration
Groups: Administration
Joined: 3/17/2009(UTC) Posts: 168  ![Germany 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.
|
|
|
|
 Rank: Guest
Groups: Guest
Joined: 3/17/2009(UTC) Posts: 1,084
Was thanked: 1 time(s) in 1 post(s)
|
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 (2)
|
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.