Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Ruft ein PublishManager-Objekt ab, um ClickOnce-Veröffentlichungen zu ermöglichen.
Namespace: VSLangProj80
Assembly: VSLangProj80 (in VSLangProj80.dll)
Syntax
'Declaration
ReadOnly Property PublishManager As Object
Object PublishManager { get; }
property Object^ PublishManager {
Object^ get ();
}
abstract PublishManager : Object
function get PublishManager () : Object
Eigenschaftswert
Typ: System.Object
Ein PublishManager-Objekt.
Beispiele
Um dieses Beispiel als Add-In auszuführen, informieren Sie sich unter Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell.In diesem Beispiel wird davon ausgegangen, dass das erste Projekt in der Projektmappe ein Visual Basic- oder Visual C#-Projekt ist.
[Visual Basic]
' Add-in code.
' Open a Visual Basic or C# project before
' running this example.
Imports VSLangProj
Imports VSLangProj80
Public Sub OnConnection(ByVal application As Object,_
ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
ByRef custom As Array) Implements IDTExtensibility2.OnConnection
applicationObject = CType(application, DTE2)
addInInstance = CType(addInInst, AddIn)
PublishManagerTest(applicationObject)
End Sub
Sub PublishManagerTest(ByVal dte As DTE2)
Dim aProject As Project
Dim aVSProject As VSProject2
aProject = applicationObject.Solution.Projects.Item(1)
MsgBox("Project kind is: " & aProject.Kind & vbCr _
& "Project name is: " & aProject.Name)
aVSProject = CType(applicationObject.Solution.Projects.Item(1)._
Object, VSProject2)
MsgBox("The full name of the project is:" _
& vbCr & aVSProject.Project.FullName)
MsgBox("The PublishManager's name is: " _
& aVSProject.PublishManager.ToString)
End Sub
[C#]
// Add-in code.
// Open a Visual Basic or C# project before
// running this example.
using System.Windows.Forms;
using VSLangProj;
using VSLangProj2;
using VSLangProj80;
public void OnConnection(object application,
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
applicationObject = (DTE2)application;
addInInstance = (AddIn)addInInst;
BuildManagerTest((DTE2)applicationObject);
}
public void BuildManagerTest(DTE2 dte)
{
Project aProject = null;
VSProject2 aVSProject = null;
aProject = applicationObject.Solution.Projects.Item(1);
MessageBox.Show("Project kind is: " + aProject.Kind +
"\n" + "Project name is: " + aProject.Name);
aVSProject = ((VSProject2)
( applicationObject.Solution.Projects.Item(1).Object));
MessageBox.Show("The full name of the project is:" +
"\n" + aVSProject.Project.FullName);
MessageBox.Show("The PublishManager's name is: "
+ aVSProject.PublishManager.ToString());
}
.NET Framework-Sicherheit
- Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter Verwenden von Bibliotheken aus teilweise vertrauenswürdigem Code.