CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Build targets

  1. #1
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Build targets

    I'm pretty experienced with C++ (MSVC) but up until today I've had no experience with C#. However, earlier today someone gave me a C# project to experiment with (i.e. a Visual Studio project). One thing struck me immediately...

    When building with C++ I need to define different build targets for building as either 32-bit or 64-bit. But in the C# project I can't immediately see anything similar. It kinda looks like the same executable will run on both (which seems counter-intuitive to me). Am I just misunderstanding something?
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Build targets

    What version of visual studio?

  3. #3
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: Build targets

    I'm running Visual Studio 2015 (Community Edition) but it looks like the VS project that I got given must have come from VS 2013.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  4. #4
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: Build targets

    In case it helps, the .sln files for my C++ projects contain entries like this:-

    Code:
    	GlobalSection(ProjectConfigurationPlatforms) = postSolution
    		{80208D6F-AD26-4CF3-980E-363F27246AD0}.Debug|Win32.ActiveCfg = Debug|Win32
    		{80208D6F-AD26-4CF3-980E-363F27246AD0}.Debug|Win32.Build.0 = Debug|Win32
    		{80208D6F-AD26-4CF3-980E-363F27246AD0}.Release|Win32.ActiveCfg = Release|Win32
    		{80208D6F-AD26-4CF3-980E-363F27246AD0}.Release|Win32.Build.0 = Release|Win32
    	EndGlobalSection
    whereas the C# .sln file looks more like this:-

    Code:
    	GlobalSection(ProjectConfigurationPlatforms) = postSolution
    		{0A5CF6D4-A6AB-400F-8772-E1C698A0D727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    		{0A5CF6D4-A6AB-400F-8772-E1C698A0D727}.Debug|Any CPU.Build.0 = Debug|Any CPU
    		{0A5CF6D4-A6AB-400F-8772-E1C698A0D727}.Release|Any CPU.ActiveCfg = Release|Any CPU
    		{0A5CF6D4-A6AB-400F-8772-E1C698A0D727}.Release|Any CPU.Build.0 = Release|Any CPU
    	EndGlobalSection
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Build targets

    There's build settings that target 32 or 64 bit or All. There is also a prefer 32 bit (for All when running on 64 bit systems).

    Right click on the project in the solution explorer and select the build settings.

  6. #6
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: Build targets

    I found them Arjay, thanks. That makes more sense now!
    "A problem well stated is a problem half solved.” - Charles F. Kettering

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured