[VB.NET ]Multiple projects
-
Hi, I am creating a visual studio add-in. And I want to add 2 projects to a solution. But I'm having a problem... If I try to edit the following MSDN code:
Sub SolutionExample(ByVal dte As DTE2) ' This function creates a solution and adds a Visual C# Console ' project to it. Try Dim soln As Solution2 = CType(DTE.Solution, Solution2) Dim csTemplatePath As String ' This path must exist on your computer. ' Replace below with an actual path. Dim csPrjPath As String = "" MsgBox("starting") ' Get the project template path for a C# console project. csTemplatePath = soln.GetProjectTemplate _ ("ConsoleApplication.zip", "CSharp") ' Create a new C# Console project using the template obtained ' above. soln.AddFromTemplate(csTemplatePath, csPrjPath, _ "New CSharp Console Project", False) MsgBox("done") Catch ex As System.Exception MsgBox(ex.ToString) End Try End Sub
like this:Sub SolutionExample(ByVal dte As DTE2) ' This function creates a solution and adds a Visual C# Console ' project to it. Try Dim soln As Solution2 = CType(DTE.Solution, Solution2) Dim csTemplatePath As String ' This path must exist on your computer. ' Replace below with an actual path. Dim csPrjPath As String = "" MsgBox("starting") ' Get the project template path for a C# console project. csTemplatePath = soln.GetProjectTemplate _ ("ConsoleApplication.zip", "CSharp") ' Create a new C# Console project using the template obtained ' above. soln.AddFromTemplate(csTemplatePath, csPrjPath, _ "New CSharp Console Project", False) MsgBox("done 1ste project") soln.AddFromTemplate(csTemplatePath, csPrjPath, _ "New CSharp Console Project 2", False) MsgBox("done 2de project") Catch ex As System.Exception MsgBox(ex.ToString) End Try End Sub
it doesn't work, Visual studio says that the solution already exists... Is there a possibilty to dynamically add 2 class libraries to a solution? Tx -- modified at 11:33 Monday 23rd January, 2006 -
Hi, I am creating a visual studio add-in. And I want to add 2 projects to a solution. But I'm having a problem... If I try to edit the following MSDN code:
Sub SolutionExample(ByVal dte As DTE2) ' This function creates a solution and adds a Visual C# Console ' project to it. Try Dim soln As Solution2 = CType(DTE.Solution, Solution2) Dim csTemplatePath As String ' This path must exist on your computer. ' Replace below with an actual path. Dim csPrjPath As String = "" MsgBox("starting") ' Get the project template path for a C# console project. csTemplatePath = soln.GetProjectTemplate _ ("ConsoleApplication.zip", "CSharp") ' Create a new C# Console project using the template obtained ' above. soln.AddFromTemplate(csTemplatePath, csPrjPath, _ "New CSharp Console Project", False) MsgBox("done") Catch ex As System.Exception MsgBox(ex.ToString) End Try End Sub
like this:Sub SolutionExample(ByVal dte As DTE2) ' This function creates a solution and adds a Visual C# Console ' project to it. Try Dim soln As Solution2 = CType(DTE.Solution, Solution2) Dim csTemplatePath As String ' This path must exist on your computer. ' Replace below with an actual path. Dim csPrjPath As String = "" MsgBox("starting") ' Get the project template path for a C# console project. csTemplatePath = soln.GetProjectTemplate _ ("ConsoleApplication.zip", "CSharp") ' Create a new C# Console project using the template obtained ' above. soln.AddFromTemplate(csTemplatePath, csPrjPath, _ "New CSharp Console Project", False) MsgBox("done 1ste project") soln.AddFromTemplate(csTemplatePath, csPrjPath, _ "New CSharp Console Project 2", False) MsgBox("done 2de project") Catch ex As System.Exception MsgBox(ex.ToString) End Try End Sub
it doesn't work, Visual studio says that the solution already exists... Is there a possibilty to dynamically add 2 class libraries to a solution? Tx -- modified at 11:33 Monday 23rd January, 2006 -
Because I am making an automatic classgenerator. It automatically generates the classes from the selected SQL tables. So I need a class library for the autogenerated classes and I need another class library for the insert, update, delete ... statements. (I am programming 3 tier) It works fine for just one class library but when I dynamically add another class library, visual studio says that the solution already exists and he can't create a second class library...