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 6613499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:13:33+00:00 2026-05-25T20:13:33+00:00

I have a project in VB.NET 2010 (compiling to x86, .NET 2.0 runtime) that

  • 0

I have a project in VB.NET 2010 (compiling to x86, .NET 2.0 runtime) that I want to compile into two separate EXEs – a “lite” version and a “full” version.

Unfortunately I cannot make two separate projects as it uses the Adobe Reader COM control – and sharing a form using that control between two projects seems to confuse the IDE (something to do with COM Interop, I assume – if someone knows how to share a form hosting the adobe reader control, that would solve my problem too).

I have found this thread:
Change name of exe depending on conditional compilation symbol however I don’t have any MSBuild experience so I need more explicit instructions.

On the “My Project>Compile” tab there is a “Build Events…” button. I was wondering if anyone knows how to set a conditional compilation constant and use that to determine the EXE name (or change it after build).

If all else fails I can rename the EXE manually I suppose, but I’d prefer it to be automated.

  • 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-25T20:13:33+00:00Added an answer on May 25, 2026 at 8:13 pm

    If having two separate projects within your solution isn’t acceptable, you’ll want to look into creating your own MSBuild script.

    Here is an example of a custom MSBuild script that will allow you to define your custom compilation constants at build time, and then build your two versions of your application (“Full” and “Lite”):

    <Project DefaultTargets="BuildAll" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <BuildVersionFull>FULL</BuildVersionFull>
        <BuildVersionLite>LITE</BuildVersionLite>
      </PropertyGroup>
      <ItemGroup>
        <Projects Include="$(MSBuildProjectDirectory)\MyApp.vbproj" />
      </ItemGroup>
      <Target Name="BuildAll" DependsOnTargets="BuildFull;BuildLite" />
      <Target Name="BuildFull">
        <MSBuild Projects="@(Projects)" Properties="DefineConstants=$(BuildVersionFull);OutputPath=binFull\;BaseIntermediateOutputPath=objFull\;AssemblyName=MyApp_Full" />
      </Target>
      <Target Name="BuildLite">
        <MSBuild Projects="@(Projects)"  Properties="DefineConstants=$(BuildVersionLite);OutputPath=binLite\;BaseIntermediateOutputPath=objLite\;AssemblyName=MyApp_Lite" />
      </Target>
    </Project>
    

    What you’ll need to do:

    1. Create a new file and save it the same directory as your application’s project file as “MyBuild.xml”.
    2. Change to reflect the name of your application’s project file.
    3. Open the Visual Studio Command Prompt and run “msbuild “.

    Within your project, you can use the “FULL” and “LITE” conditional compilation constants to determine whether to compile certain statements:

    #If FULL Then
        ' Compile code for the "Full" version.
    #End If
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 2010 project that is targeting .NET v3.5. Inexplicably I can no
I have a ASP.NET MVC 2 project on Visual Studio 2010. I want to
I have an Visual Studio 2010 ASP.Net project. And I want to deploy this
all,, I have a project that is built in VB.Net 2010 and WPF 4.
Has anyone migrated a VB6 project to .Net with Visual Studio 2010? I have
Let's imagine I already have a project building .NET 3.5 assembly. Now I want
I have a project in Java. I want transform it to .NET-project. How to
I have a .net project that has a web reference to a service. I
I have a .net project (MySolution.Common) that uses the app.config. I am using the
I have a .NET project which references another assembly that is built outside of

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.