Reputation: 4809
I'm trying to load in an assembly that is present at C:\Windows\assembly\ and is called Microsoft.VisualStudio.TextTemplating (version 9.0.0.0)
This is the command in PowerShell 2.0 I'm using
$inputfile = 'Hello.tt'
[Reflection.Assembly]::LoadWithPartialName("Microsoft.VisualStudio.TextTemplating") |
Out-Null
$server = New-Object ("Microsoft.VisualStudio.TextTemplating") $inputfile
The error I get is default.ps1:Cannot find type [Microsoft.VisualStudio.TextTemplating] make sure the assembly containing the type is loaded.
Edit: I use the same method to load in other Microsoft assemblies like Smo which are also registered in the cache, so I wonder if there's another issue around this assembly
Thanks in advance
Upvotes: 2
Views: 1593
Reputation: 754715
The problem here doesn't appear to be the assembly load. I verified that the LoadWithPartialName
method does load the assembly in question.
The problem is that your New-Object
call is being passed a namespace and not a type. You need to instead pass it a type name inside the Microsoft.VisualStudio.TextTemplating
namespace.
Upvotes: 3