I've a task to add 384 existing projects in one solution in order to replace binary file dependency with project dependency and build with msbuild. To achieve this, I'm trying to use Visual Studio API in order to automate the adding of projects to a solution.
I'm actually newbie to Windows Power Shell and I'm using Power Console plugin for Visual Studio to add project (*.csproj, *.vcxproj) files in presently opened solution using $DTE.Solution.AddFromFile (http://msdn.microsoft.com/en-us/library/envdte80.solutionfolder.addfromfile), but it doesn't seems to be working. Here is the error output:
PS> $DTE.Solution.AddFromFile('WpfApplication1.csproj')
Exception calling "AddFromFile" with "2" argument(s): "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALID
ARG))"
At line:1 char:26
+ $DTE.Solution.AddFromFile <<<< ('WpfApplication1.csproj')
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Anyone have any tips to use Visual Studio API methods via Power Console?
Farrukh