Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Create Method

Solution2.Create Method

Creates an empty solution in the specified directory with the specified name.

Namespace:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

void Create(
	string Destination,
	string Name
)

Parameters

Destination
Type: System.String

Required. The directory in which to create the .sln and .suo (solution) files.

Name
Type: System.String

Required. The name to display in Solution Explorer. This is also the base name of the .sln and .suo files.

using System.Windows.Forms;
public void CreateExample(DTE2 dte)
{
    // Creates a solution.
    try
    {
        Solution2 soln = (Solution2)_applicationObject.Solution;
        MessageBox.Show("Creating a  solution ");
        // Make sure that the file path below exists on your computer.
        // You can modify the path.
        soln.Create("c:\temp2", "ANewSoln2.sln");
    }
    catch(SystemException ex)
    {
    MessageBox.Show("ERROR: " + ex);
    }
}

Show:
© 2015 Microsoft