Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Using DTE to create a WebApi project from template gives error.

$
0
0

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




Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>