Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

T4MVC "run custom tool" generates EnvDTO 7.0 vs 8.0 csc warning

I'm getting the following warning when I right click on T4MVC.tt and select "run custom tool" (i.e. rebuild by T4MVC.cs file).

Warning 1 Compiling transformation: Assuming assembly reference 'EnvDTE, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' matches 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', you may need to supply runtime policy C:\Development\EHealth-Trunk\src\EHealth.Web\T4MVC.tt 1 1

It's no big deal really, I just don't like to have (unnecessary) warnings in my code-base...

like image 302
Tod Thomson Avatar asked Jul 26 '11 00:07

Tod Thomson


1 Answers

I haven't quite figured out what the problem is, but I did isolate it to a small repro where this happens:

<#@ template language="C#" #>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="VSLangProj" #>

<#+ 
void Test(EnvDTE.Project Project) {
    var vsProject = (VSLangProj.VSProject)Project.Object;
    var refs = vsProject.References;
}
#>

Which gets the following warning during processing:

Compiling transformation: Assuming assembly reference 'EnvDTE, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' matches 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', you may need to supply runtime policy

The only EnvDTE in my GAC is 8.0.0.0. It seems that the problem relates to the fact that VSLangProj 7.0.3300.0 (the only one I have) has a reference to EnvDTE 7.0.3300.0, which doesn’t exist.

Clearly, this is not an 'answer' quite yet, but it's the beginning of the investigation :)

like image 183
David Ebbo Avatar answered Sep 29 '22 10:09

David Ebbo