5

I've being driven up the wall trying to reference native x64 dlls in a C# app, using C# 2010 Express. I have a demo project that was converted from a 2008 project that has configuration and platform options in its properties, but the new projects that I've created don't! The dropdowns just don't exist - in fact I can't even switch from Debug to Release. Both of them use .Net Framework 4 and everything else seems the same between them.

In C++ and the converted C# project it's simple, you just open the solution's Configuration Manager and go, but my new C# project doesn't have that in the context menu.

I need to be able to reference the x64 dlls under x64 and the x86 dlls under x86, due to massive memory requirements. Can anyone explain why the option is missing or point me to how to fix it?

SilverbackNet
  • 2,076
  • 17
  • 29

2 Answers2

6

Select Build - Configuration Manager. Under the Platform select new, then select x64 there.

Pieter
  • 2,188
  • 20
  • 27
  • 1
    It doesn't exist. I have Build Solution, Rebuild Solution, and greyed-out Publish Selection. – SilverbackNet Dec 11 '10 at 01:02
  • 7
    @SilverbackNet - Go to Tools -> Options, Select "Projects and Solutions", check the "Show advanced build configurations" checkbox. You should be able to get the configuration manager now – Michael Shimmins Dec 11 '10 at 01:22
  • Doesn't work for me. I have "Show advanced build configurations" checked and still no x64. I have two projects in the solution; one has x64 as a build option, the other only has Any CPU. – Gullbyrd Dec 11 '15 at 17:45
-2

To make the project runtime configurable, first learn how to load an assembly at runtime, as in: http://support.microsoft.com/kb/837908

Use IntPtr.Size to determine which platform you are using, as in: http://msdn.microsoft.com/en-us/library/ms973190.aspx

Use a factory with the IntPtr.size parameter to obtain the correct dll, as in: http://www.go4expert.com/forums/showthread.php?t=5127#abfactory

jvdbogae
  • 1,241
  • 9
  • 15
  • 1
    My problem was that I couldn't get x64 to work at all, so I can't test or debug with it at all. I already knew I was in x86 mode. But I think I have it working now. – SilverbackNet Dec 11 '10 at 01:39