Monday, October 17, 2011

How to enable x64 platform optimization on Visual Studio C# 2010 Express

How to enable x64 platform optimization on Visual Studio C# 2010 Express

Today I’m working in access in to HP Blades chassis info from using PowerShell (HewlettPackard.Servers.BladeSystem.HPBladeSystemEnclosureCmdLets) from C#. Sounds complicated and it is. Anyway, I used C#.NET or VB.NET to run PowerShell for VMware, Exchange and Citrix until I got HP and they ruin it.

I read the brilliant HP BladeSystem PowerShell cmdlets post and tried on PowerShell and it failed until I decided to run PowerShell on Run As Administrator (not required for any of previous mentioned snap-ins) and works.

I tried to run the code from Visual Web Developer and after couple of hours decided to move the code to Visual C# console application. Tried and failed again. Nice. I started to thinking a lot in HP. Run as administrator mode and failed too.

Then I started my search and found some people complain about specific snap-ins need to run in 64bits mode.

So now is the part I think a lot on the MS how created the Visual C# Express Edition 2010. I tried to change the platform and I can’t found how to make it and take lot of time to figure out. So below is the solution:

  • On the Tools menu, select Settings and then Expert Settings.

  • On the Tools menu, select Options.

  • Enable the Show all settings checkbox below.

  • Select the Projects and Solutions option (left side) and enable the Show advanced build configurations checkbox.

  • On the Build menu, select Configuration Manager (if you don’t have the Build option, right-click in the toolbar and choose Customize and then the Build option).

  • On the Configuration Manager, choose New from the Active solution platform drop-down. On the new platform select x64 and choose to copy settings from x86.

  • To verify the setting select project properties (Project menu, project name properties), and the on Build tab, verify or set the platform to x64