Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Project.FullName Property

Gets the full path and name of the Project object's file.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)
string FullName { get; }

Property Value

Type: System.String
A string representing the full path and name of the Project object's file.

The FullName property is known as the FileName property in some versions of Visual Studio.

public void CodeExample(DTE2 dte)
{  
    try
    {   // Open a project before running this sample.
        Project prj = dte.Solution.Projects.Item(1);
        Projects prjs;
        string msg, msg2 = "Global Variables:";
        msg = "FileName: " + prj.FileName;
        msg += "\nFullName: " + prj.FullName;
        msg += "\nProject-level access to " + prj.CodeModel.CodeElements.Count.ToString() +
            " CodeElements through the CodeModel";
        prjs = prj.Collection;
        msg += "\nThere are " + prjs.Count.ToString() + " projects in the same collection.";
        msg += "\nApplication containing this project: " + prj.DTE.Name;
        if (prj.Saved)
            msg += "\nThis project hasn't been modified since the last save.";
        else
            msg += "\nThis project has been modified since the last save.";
        msg += "\nProperties: ";
        foreach (Property prop in prj.Properties)
        {
            msg += "\n  " + prop.Name;
        }
        foreach (String s in (Array)prj.Globals.VariableNames)
        {
            msg2 += "\n  " + s;
        }

        MessageBox.Show(msg, "Project Name: " + prj.Name);
        MessageBox.Show(msg2);
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.