Udostępnij za pośrednictwem


VSProject.CreateWebReferencesFolder Method

Definition

Creates the Web References folder for the project.

public:
 EnvDTE::ProjectItem ^ CreateWebReferencesFolder();
public:
 EnvDTE::ProjectItem ^ CreateWebReferencesFolder();
EnvDTE::ProjectItem CreateWebReferencesFolder();
[System.Runtime.InteropServices.DispId(5)]
public EnvDTE.ProjectItem CreateWebReferencesFolder ();
[<System.Runtime.InteropServices.DispId(5)>]
abstract member CreateWebReferencesFolder : unit -> EnvDTE.ProjectItem
Public Function CreateWebReferencesFolder () As ProjectItem

Returns

Returns a ProjectItem object.

Attributes

Examples

[Visual Basic]

' Macro Editor  
Imports VSLangProj  
' This example creates a Web references folder, if it does not   
' already exist, and displays some of the folder properties.  
Sub WebReferencesFolderExample()  
   ' This example assumes that the first project in the solution is   
   ' either a Visual Basic or C# project.  
   Dim aVSProject As VSProject = _  
      CType(DTE.Solution.Projects.Item(1).Object, VSProject)  

   ' Add a new folder if it doesn't already exist.  
   If (aVSProject.WebReferencesFolder Is Nothing) Then  
       Dim webFolder As ProjectItem  
       webFolder = aVSProject.CreateWebReferencesFolder()  
   End If  

   ' Display the name of the Web references folder.  
   Dim theFolder As ProjectItem = aVSProject.WebReferencesFolder  
   MsgBox("The name of the WebReferences folder is " _  
      & theFolder.Name & ".")  

   If (theFolder.Kind = _  
       EnvDTE.Constants.vsProjectItemKindPhysicalFolder) Then  
       MsgBox(theFolder.Name & " is a physical folder.")  
   End If  
   msgbox("There are " & theFolder.ProjectItems.Count.ToString() & _  
      " Web references.")  
End Sub  

Remarks

If the Web References folder already exists, then this property returns the ProjectItem for the existing folder.

Applies to