I have console application which uses the NFOP.dll to generate PDF document. It worked fine in the dev box, which is a 32 bit operating system.
When I moved it to another server which is having a 64 bit OS, it gave me the following error:
Could not load file or assembly 'nfop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies
Any idea on 开发者_开发问答how to resolve it? If this is an issue with using NFOP.dll on a 64 bit os, is there an alternative solution?
Thnks
Follow the below steps on a 64bit machine to build a NFOP dll with platform target (anycpu)
Download and install the Microsoft Visual J#® 2.0 Redistributable Package – Second Edition (x64) from: http://www.microsoft.com/download/en/details.aspx?id=15468
Download the NFOP project code from: http://sourceforge.net/scm/?type=svn&group_id=65558
Open the ApacheFop.Net.vjsproj file from apachefop.net folder in the downloaded code base in any of the text editor.
Change the
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
to<Platform Condition=" '$(Platform)' == '' ">anycpu</Platform>
Change the
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
to<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|anycpu' ">
Add the
<PlatformTarget>anycpu</PlatformTarget>
node to the<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|anycpu' ">
nodeSave the project file. (If you want to build in release mode, make these changes to the release configuration property group)
Open VS command prompt
Navigate to the apachefop.net folder in the downloaded code base
Run the following command in the command prompt:
msbuild ApacheFop.Net.vjsproj /t:rebuild /p:Configuration=Debug
You will get the apachefop.net.dll in the \apachefop.net\bin\Debug folder
You can use this dll to build the NFOP dll, which will be supported in both 32bit and 64 bit OS. Hope this helps!!!
Target your .NET app explicitly as an x86 compile rather than AnyCPU. It appears NFOP.dll is 32-bit only, which won't be loaded in a 64-bit process, which is what AnyCPU will do in that case.
精彩评论