This documentation is archived and is not being maintained.

OptimizeReferences Property

Visual Studio .NET 2003

Enables elimination of functions or data that are never referenced. Exposes the functionality of the /OPT linker option.

[Visual Basic .NET]
Public Property OptimizeReferences() As optRefType
[Visual Basic 6]
Property Get OptimizeReferences() As optRefType
Property Let OptimizeReferences( _
   ByVal NewValue As optRefType _
HRESULT __stdcall get_OptimizeReferences(
   /* [out, retval] */ optRefType* retVal
HRESULT __stdcall put_OptimizeReferences(
   /* [in] */ optRefType NewValue
public optRefType OptimizeReferences {get; set;}
[JScript .NET]
public function get OptimizeReferences() : optRefType
public function set OptimizeReferences(
   NewValue : optRefType


Use the optRefType enumeration to change the value of this property.


The following sample code modifies the OptimizeReferences property in the development environment:

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
  Sub Test()
    Dim prj As VCProject
    Dim cfgs, tools As IVCCollection
    Dim cfg As VCConfiguration
    Dim tool As VCLinkerTool
    prj = DTE.Solution.Projects.Item(1).Object
    cfgs = prj.Configurations
    cfg = cfgs.Item(1)
    tool = cfg.Tools("VCLinkerTool")
    tool.OptimizeReferences = optRefType.optReferences
  End Sub
End Module

See Samples for Project Model Extensibility for information on how to compile and run this sample.

See Also

Applies To: VCLinkerTool Object