I'm trying to generate a WebAPI project using the DTE in powershell. First I get the project template like so:
$projTplPath = $dte.Solution.GetProjectTemplate("WebApiApplicationProjectTemplatev4.0", "CSharp")
However, this results in error.
Exception calling "GetProjectTemplate" with "2" argument(s):
"The system cannot find the file specified.
(Exception from HRESULT: 0x80070002)" At line:1 char:1
+ $projTplPath = $dte.Solution.GetProjectTemplate("WebApiApplicationProjectTemplat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
The same call, except with a different project template name, works fine.
Where are the official project template names? Is there an enum or list somewhere? How can I generate a WebAPI project using this approach?
Thanks
-Adrian