0

I am developing an Asp.Net MVC application that is published via visual studio and IIS. The site works great and I have incorporated a label-printing system using DYMO (http://www.dymo.com/en-US/label-makers-and-label-printers?gclid=CNOyk9b-6sgCFUMTHwodQa0PWQ). The user is able to create a new inventory unit, and then a unique barcode is generated. I use the DYMO SDK to print these barcodes, and it works awesome locally through visual studio. When I publish to my server based with IIS, I get the following error when trying to print remotely:

 Retrieving the COM class factory for component with CLSID {BD0B7855-D9CB-4E13-81EF-478A5D3B3111} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

I have registered the .dll on the server, and correctly added the assembly to my project in Web.config. I believe it is a problem with 64bit/32bit, but unfortunately I am unable to change my applications platform target to run only 32bit (when changed to 32bit the entire website crashes), it currently is set at "Any CPU". I have tried setting the application pool in IIS to Allow 32bit applications also. I am not sure what else to try. Any help would be much appreciated. My problem deals with the specific .dll and how I can get it to register without changing the whole application to 32bit.

Eli
  • 533
  • 1
  • 5
  • 24
  • Possible duplicate of [C# compiling for 32/64 bit, or for any cpu?](http://stackoverflow.com/questions/5229768/c-sharp-compiling-for-32-64-bit-or-for-any-cpu) – MethodMan Oct 30 '15 at 20:26
  • No, this is completely different and deals with a specific dll and IIS @MethodMan – Eli Oct 30 '15 at 20:29
  • Setting App pool to allow 32 bit applications should do the trick.. What's the target processor (32 bit/64 bit) of the dll that you have registered? – Vinay Oct 30 '15 at 20:38
  • The dll is a 32 bit. Just tested it again, and after setting the application pool to enable 32-bit applications, it still gives me the same error. – Eli Oct 30 '15 at 20:52
  • 1
    And I'm assuming the OS you're trying to run this is x64? If that's the case then the only way out is to change your project settings to x86 and recompile your binaries and give it a shot.. If you run into issues in converting your project to x86 then check the dependencies of your project and make sure they all are either x86 or ANY CPU. If any of them are x64 then you won't be able to get a successful build. – Vinay Oct 30 '15 at 21:01
  • @Vinay after much troubleshooting, I believe the problem is with the .dll itself. Thanks for the help though. – Eli Nov 03 '15 at 16:37

1 Answers1

0

I was able to fix by adding a COM reference that needed to be installed additionally.(http://developers.dymo.com/2010/06/25/error-80040154-retreiving-com-class-factory/)

Eli
  • 533
  • 1
  • 5
  • 24