Bartender 2016 Web print example error: "Could not load file or assembly 'Seagull.BarTender.Print' or one of its dependencies" S’abonner

0
Avatar
Joseph Jazdzewski

I installed the Bartender 2016 trial on my computer today and opened the WebLabelPrint_CS project and when I run it, in the browser I get "Could not load file or assembly 'Seagull.BarTender.Print' or one of its dependencies. An attempt was made to load a program with an incorrect format.Could not load file or assembly 'Seagull.BarTender.Print' or one of its dependencies"

To check the error I went to the sdk assemblies folder and only two files the Seagull.Bartender.Print.dll and Seagull.Bartender.PrintScheduler.dll

 

If any one could point me in the right direction that would be great.

 

Thanks 

 

 

14 commentaires

0
Avatar
Jasper Wen
Modérateur
Actions pour les commentaires Permalien

I would recommend checking the following items:

  • Make sure the appropriate Seagull.BarTender.Print dll is being referenced in Visual studio as it could bolder version and referencing older version .dll. They are locating in the GAC or you can get them from the BarTender install location SDK folder (C:\Program Files\Seagull\BarTender Suite\SDK\Assemblies) when you install the BarTender .net SDK.
  • The Seagull.Bartender.Print.dll and Seagull.Bartender.PrintScheduler.dll are needed for the provided Web Label Print example that is located in C:\Program Files\Seagull\BarTender Suite\SDK\Print Server API Samples\WebLabelPrint.
  • Verify you are compiling your application for the appropriate bitness (32 bit vs 64 bit) version of BarTender you are using.
  • Check you are compiling for .net framework 4.
  • If you are using 64 bit version of BarTender, make sure that you set Visual Studio to use the 64 bit version of IIS Express. You can usually set this by going to tools->options->projects and solutions->web projects->enable the option for “Use the 64 bit version of IIS Express for web sites and projects” (This may vary depending on the version of Visual Studio you use).
0
Avatar
Chris Bremner
Actions pour les commentaires Permalien

Hi Jasper,

I am experiencing the same problem as Joseph (although I am just using Seagull.Bartender.Print.dll and not Seagull.Bartender.PrintScheduler.dll) and have fixed all of the issues you describe above:

  • I have tried referencing the DLL in both the GAC and the SDK folder
  • I am targeting a x64 platform from my Visual Studio Project, and I am using the 64 bit version of Bartender 2016 R4
  • I am targeting .NET Framework 4
  • I am deploying to a remote IIS server (IIS 10) 

If I tell the Visual Studio to include the Print DLL in /bin of the project folder, I get the same error as Joseph: " An attempt was made to load a program with an incorrect format". If I don't copy it to /bin and let the DLL be loaded from the GAC, I instead get "The system cannot find the file specified." Do you have any other ideas of things I could try?

Thanks!

0
Avatar
Jeffrey Stovall
Actions pour les commentaires Permalien

Is there an answer to the problem, "Could not load file or assembly 'Seagull.BarTender.Print, Version=11.0.6.1, Culture=neutral, PublicKeyToken=109ff779a1b4cbc7' or one of its dependencies. An attempt was made to load a program with an incorrect format." ?

I'm using Visual Studio 2012, targeting .net Framework 4.5.  Using Bartender 2016 64 bit 

When compiling, I see the following warning:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3102,5): warning MSB3187: Referenced assembly 'C:\Source\MASTERlink\MASTERlink.PrintManager\Release 1.7.0.0-ElxSprInputSrvc-SDK\MASTERlink.PrintManager\MASTERlink.PrintManager.Library\bin\Debug\Seagull.BarTender.Print.dll' targets a different processor than the application.

What processor does the Seagull.BarTender.Print.dll target?

0
Avatar
Jonathan DuPen
Actions pour les commentaires Permalien

 

 

Jeff, it sounds like you are targeting the X86 platform.
If you go to your assembly (project's) properties (Right click on the project), and click on the Build tab on the left hand side, make sure that your Platform Target matches x64 and not x86, 

Also, if you are running unit tests, there is a default process architecture setting under Test>Test Settings> Default Processor Architecture>


Your 64 bit version should target the x64 platform.

0
Avatar
Jonathan DuPen
Actions pour les commentaires Permalien

Hi Chris,

Is it possible you using a Visual Studio WebService/Website or project that was build against the previous 32 bit version of Bartender? 

I had the same problem, and the solution is to download the 32 bit of Bartender 2016 as the new 64 bit version is not backwards compatible, and the 64 bit version is mainly for Active X use.

"If you have a custom 32-bit print client application that previously used BarTender's 32-bit Print SDK (Seagull.BarTender.dll), you must install the 32-bit version of BarTender. The 64-bit version will not work with your application. Howevver, you can install the 32-bit version of BarTender even if you have a 64-bit processor and a 64-bit OS."

Hope this helps.

0
Avatar
Jeffrey Stovall
Actions pour les commentaires Permalien

I am now using the 64 bit version of Bartender 2016 and the SDK dll that comes with it.  I had to switch to using Visual Studio 2015 instead of 2012.

 Everything is working now.

 Thanks,

Jeff

0
Avatar
Chris Bremner
Actions pour les commentaires Permalien

Hi Jonathan,

It's been a little while since I resolved this problem, but I forgot to come back here and update what I did. I believe I did the same thing as you -- downloaded the 32 bit version. It's been running smoothly since August.

Thanks for following up!

 

0
Avatar
Nalini Sindphale
Actions pour les commentaires Permalien

@Chris Bremner

Can you tell you downloaded the 32 bit version of what? 

I am having same issue. My IIS is pointing to X86 and Bartender is 64 bit version. 

I cannot change IIS from  X86 to X64 as it breaks the server. 

I get following error. I have tried different solutions but still no progress

 

Could not load file or assembly 'Seagull.BarTender.Print, Version=11.0.7.1, Culture=neutral, PublicKeyToken=109ff779a1b4cbc7' or one of its dependencies. The system cannot find the file specified.

 

 

 
0
Avatar
Nalini Sindphale
Actions pour les commentaires Permalien

@Chris Bremner

Can you tell you downloaded the 32 bit version of what? 

I am having same issue. My IIS is pointing to X86 and Bartender is 64 bit version. 

I cannot change IIS from  X86 to X64 as it breaks the server. 

I get following error. I have tried different solutions but still no progress

 

Could not load file or assembly 'Seagull.BarTender.Print, Version=11.0.7.1, Culture=neutral, PublicKeyToken=109ff779a1b4cbc7' or one of its dependencies. The system cannot find the file specified.

 

 

 
0
Avatar
Chris Bremner
Actions pour les commentaires Permalien

@Nalini I did what @Jonathan DuPen did here, which was download the 32-bit version of Bartender 2016.

0
Avatar
Nalini Sindphale
Actions pour les commentaires Permalien

Thank you for reply, Chris. 

I still get the error with 32 bit version 

 

"Could not load file or assembly 'Seagull.BarTender.Print, Version=11.0.7.1, Culture=neutral, PublicKeyToken=109ff779a1b4cbc7' or one of its dependencies. The system cannot find the file specified."

0
Avatar
Jonathan DuPen
Actions pour les commentaires Permalien

Hi Nalini,

Did you remember to switch the platform of your project to x86?  I know IIS is targeted to x86, but what about your build platform?

0
Avatar
Nalini Sindphale
Actions pour les commentaires Permalien

Yeah both build and IIS is pointing to x86

 

Here is the new error I get. I checked user access but nothing found 

 

The BarTender engine could not be started. Possible reasons are: 1) BarTender is not properly installed. 2) BarTender is not properly registered on the computer (e.g bartend.exe /register). 3) There are too many process instances of BarTender running. Stop a few bartend.exe instances and try again. Also see SDK Engine.Start method documentation for information about how to allow more BarTender processes to run on your computer by increasing your "non-interactive" shared desktop heap. 4) The user account does not have permission to run BarTender.

0
Avatar
Nalini Sindphale
Actions pour les commentaires Permalien

Old error "Could not load file or assembly 'Seagull.BarTender.Print, Version=11.0.7.1, Culture=neutral, PublicKeyToken=109ff779a1b4cbc7' or one of its dependencies. The system cannot find the file specified." is gone. 

Vous devez vous connecter pour laisser un commentaire.