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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:07:29+00:00 2026-06-04T05:07:29+00:00

I have a simple little command-line program, written in C#, running under .NET 4.0,

  • 0

I have a simple little command-line program, written in C#, running under .NET 4.0, and compiled with Visual Studio 10.0.

What it does is pull data out of another vendor’s Access.mdb file, and insert it into a Sql Server database, so one of our apps can access the data.

We’re using .NET’s OleDbConnection/OleDbCommand/OleDbDataReader classes, using Microsoft.Jet.OLEDB.4.0 as the data provider.

This worked fine, for us, until we tried to run in on 64-bit machines. It turns out that there is no 64-bit OleDb provider for .NET. There are vague, half-clear threads on the problem scattered all over the web, with discussions of different versions of Access, or MDAC, or Office, or whatever, that somehow made things work for some people.

What we did was configure the project to target x86. And the problem went away.

Now it’s back, for reasons I simply don’t understand. When I build the program on my local machine, it runs as x86, but when I build it on our build machine, it runs as x64.

The project file is clearly configured to target x86:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>x86</PlatformTarget>
</PropertyGroup>

It’s built from the same batchfile, whether on my machine or on the build machine:

msbuild OurApp.sln /property:Configuration=Release

And the generated exes say they are x86, regardless of which machine they are built on. If I run dumpbin /headers on either, I see:

FILE HEADER VALUES
         14C machine (x86)
           3 number of sections
    4FBA64C8 time date stamp Mon May 21 10:52:40 2012
           0 file pointer to symbol table
           0 number of symbols
          E0 size of optional header
         102 characteristics
               Executable
               32 bit word machine

The only difference between the dumps of an exe built on my machine and an exe built on the build machine is the timestamp and the path to the .pdb file.

But, and here’s the odd thing, an exe built on my machine runs just fine, one built on the build machine errors out with the same error message we had seen when we’d built it as x64.

More than that – our program gets its configuration from the registry, and for the convenience of the user, if it doesn’t find a setting, it creates one. We read them from, and create them in, HLM\SOFTWARE\OurName\OurApp. But, of course, since this is a 32-bit app running on a 64-bit machine, it really should be reading to and writing from HLM\SOFTWARE\WoW6432Node\OurName\OurApp.

And with the apps built on my machine, it does. But the apps that are built on the build machine, despite being compiled for x86, and having headers that indicate that they should be run as x86, read and write from HLM\SOFTWARE\OurName\OurApp and not from HLM\SOFTWARE\WoW6432Node\OurName\OurApp. As if it was actually running as a 64-bit app, despite everything.

Does anyone have any idea how this could be happening?

  • 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-06-04T05:07:30+00:00Added an answer on June 4, 2026 at 5:07 am

    OK, this is just aggravating.

    What we had had, in the .csproj file, was this:

    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <DebugSymbols>true</DebugSymbols>
        <DebugType>full</DebugType>
        <Optimize>false</Optimize>
        <OutputPath>bin\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <PlatformTarget>x86</PlatformTarget>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <DebugType>pdbonly</DebugType>
        <Optimize>true</Optimize>
        <OutputPath>bin\Release\</OutputPath>
        <DefineConstants>TRACE</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
    </PropertyGroup>
    

    It’s what resulted from taking the default configuration, and changing it to target x86.

    I removed the AnyCPU configurations, and created new x86 configurations, and got:

    <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
        <DebugSymbols>true</DebugSymbols>
        <OutputPath>bin\x86\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE</DefineConstants>
        <DebugType>full</DebugType>
        <PlatformTarget>x86</PlatformTarget>
        <ErrorReport>prompt</ErrorReport>
        <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
        <OutputPath>bin\x86\Release\</OutputPath>
        <DefineConstants>TRACE</DefineConstants>
        <Optimize>true</Optimize>
        <DebugType>pdbonly</DebugType>
        <PlatformTarget>x86</PlatformTarget>
        <ErrorReport>prompt</ErrorReport>
        <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
        <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
    </PropertyGroup>
    

    Now I could have sworn that the GUI was telling me I was targeting x86 both in debug and in release, in the old configuration. And that the resulting executables dumped as being x86, and ran as x86 on my machine. But apparently I was getting confused about what versions of the exe were being built under what conditions, because looking at the .csproj, it’s clear that we were not specifying x86, when building release.

    In any case, with the new config the exes build and run, regardless of what machine they’re built on, or which they’re run on.

    In any case, sorry to have troubled you, and thanks for providing the ear that got me to look at the problem in the right way.

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

Sidebar

Related Questions

I have a simple little test app written in Flex 3 (MXML and some
So I have a simple little macro/sub defined when a command button is clicked.
I have a simple little code fragment that is frustrating me: HashSet<long> groupUIDs =
Hi and thanks for looking! Background I have made a simple little app in
A little stuck here. I have a simple question I guess. Given the following
I have a little problem with a simple vbScript. The script has to run
This is a very simple question yet I have little knowledge in Linux and
What I want to do should be very simple, however I have little to
I'm running a script from the command line via R CMD BATCH script.in.R script.out.R
First, a little background : I have written a little application in python with

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.