Home : Workaround for a license compiler exception on 64-bit systems with VS2010 .Net 4.0
Q10341 - INFO: Workaround for a license compiler exception on 64-bit systems with VS2010 .Net 4.0

We have found that there is a bug in Visual Studio when it comes to building a 64-bit application on a 64-bit system. Visual Studio will use the 32-bit version of license compiler (LC.exe) when the build configuration is set to x64.

Please note, this article refers to the .NET Framework 4.0 ... for correct information regarding the .NET framework 2.0, please refer to Q10288 - INFO: Workaround for a license compiler exception on 64-bit systems with VS2008/VS2010 .Net 2.0

To workaround this issue you will need to modify your application project file in a text editor. Add the highlighted line shown below to all of your 64-bit build configurations:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
 <DebugSymbols>true</DebugSymbols>
   <OutputPath>bin\x64\Debug\</OutputPath>
 <DefineConstants>DEBUG;TRACE</DefineConstants>
 <DebugType>full</DebugType>
 <PlatformTarget>x64</PlatformTarget>
 <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
 <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
 <ErrorReport>prompt</ErrorReport>
 <LCToolPath>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64</LCToolPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
 <OutputPath>bin\x64\Release\</OutputPath>
 <DefineConstants>TRACE</DefineConstants>
 <Optimize>true</Optimize>
 <DebugType>pdbonly</DebugType>
 <PlatformTarget>x64</PlatformTarget>
 <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
 <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
 <ErrorReport>prompt</ErrorReport>
 <LCToolPath>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64</LCToolPath>
</PropertyGroup>

This will tell Visual Studio where to get the license compiler during a build.

For more information, please see:

Q10165 - FAQ: Cause of System.BadImageFormatException

Q10149 - INFO: Compiling with DotImage on a 64-bit system

Q10406 - FIX: Drag-Drop of Some Atalasoft Viewers Not Adding Control to Designer

Q10288 - INFO: Workaround for a license compiler exception on 64-bit systems with VS2008/VS2010 .Net 2.0

Q10158 - INFO: Warning:Referenced assembly targets a different processor

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2017. InstantASP Ltd. All Rights Reserved