Udostępnij za pośrednictwem


Solution4.Create(String, String) Method

Definition

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

public:
 void Create(System::String ^ Destination, System::String ^ Name);
public:
 void Create(Platform::String ^ Destination, Platform::String ^ Name);
void Create(std::wstring const & Destination, std::wstring const & Name);
[System.Runtime.InteropServices.DispId(40)]
public void Create (string Destination, string Name);
[<System.Runtime.InteropServices.DispId(40)>]
abstract member Create : string * string -> unit
Public Sub Create (Destination As String, Name As String)

Parameters

Destination
String

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

Name
String

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

Implements

Attributes

Examples

Sub CreateExample(ByVal dte As DTE2)  
    ' Create a  solution.  
    Try  
        Dim soln As Solution4 =  _  
        CType(_applicationObject.Solution, Solution4)  
        MsgBox("Creating a new solution ")  
        ' Make sure that the file path below exists on your computer.  
        ' You can modify the path.  
        soln.Create("c:\temp2", "ANewSoln.sln")  
    Catch ex As System.Exception  
        MsgBox(ex.ToString)  
    End Try  
End Sub  
using System.Windows.Forms;  
public void CreateExample(DTE2 dte)  
{  
    // Create a solution.  
    try  
    {  
        Solution4 soln = (Solution4)_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);  
    }  
}  

Applies to