Jump to content
CodeGuru

.net Sdk - Compatibility With .net Framework 4.0

Recommended Posts

CodeGuru

I'm trying to use the BarTender 9.4 print engine with an application that uses version 4.0 of the .NET Framework.

 

When I attempt to start the print engine, I get an exception.

 

Here's the code:

.
.
.
// Create and start a new BarTender Print Engine.
try
{
  _engine = new Engine(true);
}
catch (Exception exception)
{
  MessageBox.Show(this, exception.Message, AppName);
  Close(); // Close this app. We cannot run without connection to an engine.
  return;
}
.
.
.

 

Here's the exception:

Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

 

Can someone please tell me where I can get the .Net 4.0 compatible COM wrapper library for the BarTender 9.4 ActiveX automation library?

 

Best regards,

 

CG

Share this post


Link to post
Share on other sites
Shotaro I - Seagull Support

Hi CodeGuru,

 

Modifying the app.config should work to overcome the mixed mode exception.

To be sure it works you could try creating a file by the name of:

<appname>.exe.config

where <appname> is the name of the file. In this file place the contents as:

<startup useLegacyV2RuntimeActivationPolicy="true"> 
 <supportedRuntime version="v4.0"/> 
</startup>

For more information about the useLegacyV2RuntimeActivationPolicy flag see:

http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx

www.marklio.com/marklio/PermaLink,guid,ecc34c3c-be44-4422-86b7-900900e451f9.aspx

 

hope that helps!

Share this post


Link to post
Share on other sites
Mike413

Hi CodeGuru,

 

Modifying the app.config should work to overcome the mixed mode exception.

To be sure it works you could try creating a file by the name of:

<appname>.exe.config

where <appname> is the name of the file. In this file place the contents as:

<startup useLegacyV2RuntimeActivationPolicy="true"> 
 <supportedRuntime version="v4.0"/> 
</startup>

For more information about the useLegacyV2RuntimeActivationPolicy flag see:

http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx

www.marklio.com/marklio/PermaLink,guid,ecc34c3c-be44-4422-86b7-900900e451f9.aspx

 

hope that helps!

 

How can you guys not fix this? There should be no need for us to have to add this in the configuration file, this is just one more thing for a developer to worry about not to mention the side effect that this can bring about in other parts of your code that will be incredible difficult to debug.

 

Are there any plans to get rid of the need for this hack?

 

Thanks.

Share this post


Link to post
Share on other sites
Mike413

Is someone from Segull going to answer my question?

 

I ask once again, are you guys planning to fix this or is the hack the only solution Segull is willing to provide?

 

Thanks.

Share this post


Link to post
Share on other sites
Shotaro I - Seagull Support

Dear Mike,

I'm sorry that I've replied late, and thank you for your suggestion to improve compatibility with the latest .net Framework.

I've asked to our development division.

At some point, we will upgrade BarTender to use 4.0, and this issue will go away. But we still support .NET framework versions less than 4.0. Right now, we have a product that works with 2.0, 3.0, 3.5, and 4.0 - but 4.0 requires additional configuration to use it.

Obviously it would be better for us to find a way to do it automatically, and we'll look at that for future version.

Share this post


Link to post
Share on other sites
BumpaRoy

Just loaded the v 10 release. Still has this .Net 4 compatibility issue.

Share this post


Link to post
Share on other sites
BumpaRoy

I am using the .Net SDK from a .dll. I added a app.config file to the .dll and added the workaround code. I am still getting the problem. Then I added the workaround to the app.config file of the calling program (the program calling the .dll) and I am still getting this error. Please don't tell me that I can't use the .Net Sdk from within a .net 4 dll.

Share this post


Link to post
Share on other sites
Siva77

Hi,

Could not load file or assembly 'Seagull.Interop, Version=9.30.0.0, Culture=neutral, PublicKeyToken=109ff779a1b4cbc7' or one of its dependencies. The system cannot find the file specified.I am also getting this error .How can I resolve this issue ...........Please any one replay to me

Share this post


Link to post
Share on other sites
BumpaRoy

I am using the .Net SDK from a .dll. I added a app.config file to the .dll and added the workaround code. I am still getting the problem. Then I added the workaround to the app.config file of the calling program (the program calling the .dll) and I am still getting this error. Please don't tell me that I can't use the .Net Sdk from within a .net 4 dll.

 

Any one from Seagull listening??

Share this post


Link to post
Share on other sites
Shotaro I - Seagull Support

At this moment, BarTender(10.0SR1 at this point) not support .net 4.0, so you still requires useLegacyV2RuntimeActivationPolicy setting.

About DLL, I don't have enough knowledge to answer that, so I'm checking with Development division.

Share this post


Link to post
Share on other sites
Shotaro I - Seagull Support

Hi,

Could not load file or assembly 'Seagull.Interop, Version=9.30.0.0, Culture=neutral, PublicKeyToken=109ff779a1b4cbc7' or one of its dependencies. The system cannot find the file specified.I am also getting this error .How can I resolve this issue ...........Please any one replay to me

If not too late..

Make sure you have installed and Activated The version(9.3) of BarTender(with Printer Maestro, BarTender system service).

Check if .net Print SDK sample works properly on the same PC.

This post might helps..

My link

Share this post


Link to post
Share on other sites
BumpaRoy

At this moment, BarTender(10.0SR1 at this point) not support .net 4.0, so you still requires useLegacyV2RuntimeActivationPolicy setting.

About DLL, I don't have enough knowledge to answer that, so I'm checking with Development division.

 

Please respond to me as soon as possible. This is a critical app and needs to be delivered soon. If I need to find a workaround, I have to get on it ASAP.

Share this post


Link to post
Share on other sites
BumpaRoy

At this moment, BarTender(10.0SR1 at this point) not support .net 4.0, so you still requires useLegacyV2RuntimeActivationPolicy setting.

About DLL, I don't have enough knowledge to answer that, so I'm checking with Development division.

 

I really need an answer on this .....

Share this post


Link to post
Share on other sites
Shotaro I - Seagull Support

Try

 

Build a DLL which references Seagull.BarTender.Print, with build setting of .net 3.5 Profile. No "web.config" in the project.

 

Create a caller application with .net 4.0 Profile. modify web.config to add <startup useLegacyV2RuntimeActivationPolicy="true">...

 

Note that .net Print SDK is 32bit(x86) project, so if you run the project on x64, set build target to x86 (not Any CPU).

 

Hope that helps.

Share this post


Link to post
Share on other sites
BumpaRoy

Try

 

Build a DLL which references Seagull.BarTender.Print, with build setting of .net 3.5 Profile. No "web.config" in the project.

 

Create a caller application with .net 4.0 Profile. modify web.config to add <startup useLegacyV2RuntimeActivationPolicy="true">...

 

Note that .net Print SDK is 32bit(x86) project, so if you run the project on x64, set build target to x86 (not Any CPU).

 

Hope that helps.

 

When will this be fixed? It's not like .Net 4.0 was just released.

Share this post


Link to post
Share on other sites
Shotaro I - Seagull Support

When will this be fixed? It's not like .Net 4.0 was just released.

Did the workaround above work?

 

Needless to say one day it need to be changed, however I cannot tell when that is going to be happen at the moment.

 

The concern is, once .net SDK is moved to .net 4.0, it would lose compatibility with .net 2.0 - 3.5 project, that also lose compatibility with Visual studio 2005 - 2008, which still widely being used.

 

I understand the importance of this issue and push it once again in feature request.

Share this post


Link to post
Share on other sites
BumpaRoy

Did the workaround above work?

 

Needless to say one day it need to be changed, however I cannot tell when that is going to be happen at the moment.

 

The concern is, once .net SDK is moved to .net 4.0, it would lose compatibility with .net 2.0 - 3.5 project, that also lose compatibility with Visual studio 2005 - 2008, which still widely being used.

 

I understand the importance of this issue and push it once again in feature request.

 

First, I appreciate the response, even though it is not what I want to hear. All new development is being done on .Net 4.0 plus. So you are really hindering new development. Because the nature of the beast in component development, and the importance of legacy apps, you need to support both 2.0 and 4.0. All of the other component developers do this. If you don't embrace the new, your base will never grow and probably will shrink as other solutions provide what your not.

 

I will be testing the work around today.

Share this post


Link to post
Share on other sites
BumpaRoy

Work around did not work. I have to call Bartender from a .dll (which is .Net 4.0). No .dlls don't read the app.config files, so this is of no use.

 

MAJOR issue. There should be no excuse to not having a .Net 4.0 SDK. Sorry, but I have wasted alot of time.

Share this post


Link to post
Share on other sites
BumpaRoy

Take that back. I did get the work around fixed. Sorry for the last post .. however this has been much more difficult than it needed to be.

Share this post


Link to post
Share on other sites
Shotaro I - Seagull Support

Hi Bumparoy, thanks for the update - good to hear the workaround worked. Seeing some users having trouble with it, I hope we can fix that sooner to make simple implementation with projects using newer framework.

Share this post


Link to post
Share on other sites
Ian C - BarTender ninja @ Seagull

To Bumparoy and others; we will be supporting the .NET Framework v4.0, but it will be some time until this is implemented due to other priorities and compatibility issues. Please bear with us and use the acknowledged, less than perfect, workaround meanwhile.

Share this post


Link to post
Share on other sites
Rene

.Net 4.5 is out now.... I certainly hope that Seagull will support 4.5 natively so that we don’t have to apply some hack to make it work like we do today. I realize is more work for Seagull to maintain more versions but its the right thing to do for your customers.

 

Thanks.

Share this post


Link to post
Share on other sites
Ian C - BarTender ninja @ Seagull

Acknowledged, but the answer is still the same.

Share this post


Link to post
Share on other sites
BumpaRoy

This topic was started in September of 2011. It is now November 2012. Has Seagull made any inroads here to support .Net 4 and up?? The workaround code is a pain haveing to write a .Net 2.0 dll and such (read thread). It makes maintenace much harder.

 

Again, have you made any effort?? If not, the Bartender SDK may not be the way to go long term if you are not committed to the SDK.

Share this post


Link to post
Share on other sites

×