Question

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

Was it helpful?

Solution

Follow the below steps on a 64bit machine to build a NFOP dll with platform target (anycpu)

  1. 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

  2. Download the NFOP project code from: http://sourceforge.net/scm/?type=svn&group_id=65558

  3. Open the ApacheFop.Net.vjsproj file from apachefop.net folder in the downloaded code base in any of the text editor.

  4. Change the <Platform Condition=" '$(Platform)' == '' ">x86</Platform> to <Platform Condition=" '$(Platform)' == '' ">anycpu</Platform>

  5. Change the <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> to <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|anycpu' ">

  6. Add the <PlatformTarget>anycpu</PlatformTarget> node to the <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|anycpu' "> node

  7. Save the project file. (If you want to build in release mode, make these changes to the release configuration property group)

  8. Open VS command prompt

  9. Navigate to the apachefop.net folder in the downloaded code base

  10. 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!!!

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top