Reference3.Remove 메서드

참조가 포함된 References 개체에서 참조를 제거합니다.

네임스페이스:  VSLangProj80
어셈블리:  VSLangProj80(VSLangProj80.dll)

구문

‘선언
Sub Remove
void Remove()
void Remove()
abstract Remove : unit -> unit 
function Remove()

예제

이 예제에서는 열린 Visual Basic 또는 Visual C# 프로젝트에 참조를 추가했다가 제거합니다.이 예제를 추가 기능으로 실행하려면 방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행을 참조하십시오.

추가되는 참조의 기본 경로는 <설치 루트>\Program Files\Microsoft SQL Server\90\SDK\Assemblies입니다.예제의 <file path>를 이 경로 또는 적절한 다른 파일 경로로 바꿉니다.

Imports VSLangProj
Imports VSLangProj2
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)
    TestRemove(applicationObject)
End Sub
Public Sub TestRemove(ByVal dte As DTE2)
    ' The first project is a Visual Basic or C# project.
    Dim vsProject As VSProject2 = _
    CType(dte.Solution.Projects.Item(1).Object, VSProject2)
    ' Add a reference.
    Dim newRef As Reference3
    ' Replace <file path> with an actual file path.
    newRef = CType(vsProject.References.Add
("<file path>\Microsoft.SqlServer.Smo.dll"), _
    Reference3)
    MsgBox("Added a reference " & newRef.Name)
    newRef.Remove()
    MsgBox("Removed the reference...")
End Sub
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;
    TestRemove(((DTE2)applicationObject));
}
public void TestRemove(DTE2 dte)
{
    // The first project is a Visual Basic or C# project.
    VSProject2 aProject =
((VSProject2)(applicationObject.Solution.Projects.Item(1).Object));
    Reference3 aRef = null;
    // Replace <file path> with an actual file path.
    aRef = (Reference3)aProject.References.Add
(@"<file path>\ Microsoft.SqlServer.Smo.dll ");
    MessageBox.Show("Added a new reference " + aRef.Name);
    aRef.Remove();
    MessageBox.Show("removed the reference...");
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

Reference3 인터페이스

Remove 오버로드

VSLangProj80 네임스페이스