How do I convert this to VB.NET?...I already tried running it through some online converters with no luck.
Its one of the first lines in a T4 file...
var dte = (DTE)((IServiceProvider)Host).GetService(typeof(SDTE));
Here is the VB that is spit out from on online converters:
Dim dte As EnvDTE.DTE= DirectCast(DirectCast(Host, IServiceProvider).GetService(GetType(SDTE)), DTE)
But that VB ends up producing this error:
Error 27 Running transformation: System.MissingMemberException: Public member 'get_FileNames' on type 'ProjectItem' not found.
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
at Microsoft.VisualStudio.TextTemplating132CC2683BD8FD0FA5FF78F66A6D1A48.GeneratedTextTransformation.GetProjectContainingT4File(Project project, String t4FileName) in D:\My Projects\OakMap\Application\OakMap\StaticContent.tt:line 73
at Microsoft.VisualStudio.TextTemplating132CC2683BD8FD0FA5FF78F66A6D1A48.GeneratedTextTransformation.GetProjectContainingT4File(DTE dte, String t4FileName) in D:\My Projects\OakMap\Application\OakMap\StaticContent.tt:line 59
at Microsoft.VisualStudio.TextTemplating132CC2683BD8FD0FA5FF78F66A6D1A48.GeneratedTextTransformation.TransformText() in D:\My Projects\OakMap\Application\OakMap\StaticContent.tt:line 23 D:\My Projects\OakMap\Application\OakMap\StaticContent.tt 1 1
I am using this code for ref: http://www.jacopretorius.net/2009/06/generating-strongly-typed-content-links.html