Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6074103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:20:41+00:00 2026-05-23T10:20:41+00:00

We have a large VS 2010 solution that is mostly C# code but there

  • 0

We have a large VS 2010 solution that is mostly C# code but there are a few native DLLs that various C# projects depend upon (including our unit testing DLL). We’re in the processing of trying to support both 32-bit and 64-bit versions of our libraries. So we’re now build the native DLLs as 32-bit and 64-bit. The problem is that a lot of our C# project’s have post-build events that copy the required native DLLs into the project’s TargetDir. Now that we have two different versions of the native DLLs (32 and 64 bit), I need to be able to specify the correct dir to copy the native DLL from. I originally thought I could simply use $(Platform) in the path like so:

copy $(SolutionDir)\NativeDll\$(Platform)\$(Configuration) $(TargetDir)

But that doesn’t work because $(Platform) is the project’s platform and not the solution level platform. In this case $(Platform) is “Any CPU”. From what I can see looking at the post-build event macros in C# project, there doesn’t appear to be a way to access the solution level platform that is being built. Is there a better way to accomplish my goal?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:20:42+00:00Added an answer on May 23, 2026 at 10:20 am

    I believe the solution’s platform, unlike that of the projects is simply text.

    What I have done in the past is:

    1. Delete Win32 and "mixed platform" from solution (and keep doing so after adding projects).

    2. Set all C# DLLs to build as AnyCPU in solution platforms AnyCPU, x86, x64.
      (Do not delete AnyCPU if you want to be able to open in Blend or if you have any pure managed applications in the solution.)

    3. Set C# EXEs and unit tests to build in x86 in x86 solution platform and x64 in x64 solution platform and not to build at all in AnyCPU solution platform.

    4. Set all natives to build in Win32 when solution is x86 and output to $(ProjectDir)\bin\x86$(Configuration) and intermediate to same with obj in path instead of bin. x64 the same with x64 instead of x86 and Win32.

    5. Set pre build events of C# EXEs and unit tests to copy native DLLs they are depended on from relative path with project’s configuration name: $(Config)

    6. Set unit tests’ class initialize to copy entire contents of tests bin dir (correct platform and configuration, of course) to tests’ out dir. Use if #DEBUG and unsafe sizeof(IntPtr) to tell where to look for tests’ bin dir.

    7. Manually (using Notepad) add relative reference path to .csproj files outside solution that use x86/x64 assemblies from solution’s deployment location, so path will include $(Platform) and $(Configuration) and will not be per user.

    Microsoft: Better 32/64 bit support in Visual Studio would be really in place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large solution, of some 320 projects, where even small changes to
I have some large projects hosted in Team Foundation Server 2010 Source Control. This
I have a large project that is quite a mess. There's God classes, poor
I have large batches of XHTML files that are manually updated. During the review
I'm developing a website in PHP and I have large JS files that I
I have a large codebase that targetted Flash 7, with a lot of AS2
I have a large database and would like to select table names that have
Visual Studio 2010 RC -> Silverlight Application We have a library of images that
I have a rather large amount of data (100 MB or so), that I
I have several large websites that I wish to create a WIX installer for.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.