ICscHostObject4.SetPlatformWith32BitPreference Method

Sets the /platform value to AnyCPU32BitPreferred.

MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.

Namespace:  Microsoft.Build.Tasks.Hosting
Assembly:  Microsoft.Build.Tasks.Core (in Microsoft.Build.Tasks.Core.dll)

Syntax

'Declaration
Function SetPlatformWith32BitPreference ( _
    platformWith32BitPreference As String _
) As Boolean
bool SetPlatformWith32BitPreference(
    string platformWith32BitPreference
)
bool SetPlatformWith32BitPreference(
    String^ platformWith32BitPreference
)
abstract SetPlatformWith32BitPreference : 
        platformWith32BitPreference:string -> bool
function SetPlatformWith32BitPreference(
    platformWith32BitPreference : String
) : boolean

Parameters

  • platformWith32BitPreference
    Type: System.String

    true to set the /platform value to AnyCPU32BitPreferred; otherwise, false.

Return Value

Type: System.Boolean
true if the method was successful.

Remarks

If the Prefer32Bit property is set on the project, SetPlatformWith32BitPreference changes the /platform value from AnyCPU or the default value (nulla null reference (Nothing in Visual Basic) or "") to AnyCPU32BitPreferred. For more information, see /platform (C# Compiler Options).

If the /platform value is set to AnyCPU (/platform:AnyCPU), your application runs as a 64-bit process whenever possible and falls back to 32-bit for 32-bit-only systems. However, you might prefer an application to run as a 32-bit process because 64-bit applications may consume more memory. The AnyCPU32BitPreferred setting is similar to AnyCPU, except that its default action is to run applications in 32-bit mode on systems that support either mode. This setting accommodates future processors that may not fall back to 32-bit mode.

.NET Framework Security

See Also

Reference

ICscHostObject4 Interface

Microsoft.Build.Tasks.Hosting Namespace