Jump to content


Photo
- - - - -

.net Sdk - Compatibility With .net Framework 4.0


  • Please log in to reply
30 replies to this topic

#1 CodeGuru

CodeGuru

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 12 September 2011 - 07:59 AM

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

#2 Shotaro I - Seagull Support

Shotaro I - Seagull Support

    Member

  • Moderators
  • 421 posts
  • LocationJapan

Posted 12 September 2011 - 10:30 PM

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.microsof...y/bbx34a2h.aspx
www.marklio.com/marklio/PermaLink,guid,ecc34c3c-be44-4422-86b7-900900e451f9.aspx

hope that helps!

#3 Mike413

Mike413

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 10 November 2011 - 02:49 PM

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.microsof...y/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.

#4 Mike413

Mike413

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 14 November 2011 - 05:13 PM

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.

#5 Mike413

Mike413

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 16 November 2011 - 01:52 PM

Seagull???

#6 Shotaro I - Seagull Support

Shotaro I - Seagull Support

    Member

  • Moderators
  • 421 posts
  • LocationJapan

Posted 16 November 2011 - 05:02 PM

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.

#7 BumpaRoy

BumpaRoy

    Member

  • Members
  • PipPip
  • 20 posts

Posted 20 June 2012 - 11:53 AM

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

#8 BumpaRoy

BumpaRoy

    Member

  • Members
  • PipPip
  • 20 posts

Posted 20 June 2012 - 12:11 PM

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.

#9 Siva77

Siva77

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 25 June 2012 - 04:15 PM

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

#10 BumpaRoy

BumpaRoy

    Member

  • Members
  • PipPip
  • 20 posts

Posted 26 June 2012 - 05:26 AM

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??

#11 Shotaro I - Seagull Support

Shotaro I - Seagull Support

    Member

  • Moderators
  • 421 posts
  • LocationJapan

Posted 26 June 2012 - 08:18 PM

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.

#12 Shotaro I - Seagull Support

Shotaro I - Seagull Support

    Member

  • Moderators
  • 421 posts
  • LocationJapan

Posted 26 June 2012 - 08:35 PM

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

#13 BumpaRoy

BumpaRoy

    Member

  • Members
  • PipPip
  • 20 posts

Posted 27 June 2012 - 05:57 AM

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.

#14 BumpaRoy

BumpaRoy

    Member

  • Members
  • PipPip
  • 20 posts

Posted 28 June 2012 - 05:52 AM

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

#15 Shotaro I - Seagull Support

Shotaro I - Seagull Support

    Member

  • Moderators
  • 421 posts
  • LocationJapan

Posted 28 June 2012 - 09:47 PM

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.

#16 BumpaRoy

BumpaRoy

    Member

  • Members
  • PipPip
  • 20 posts

Posted 29 June 2012 - 08:26 AM

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.

#17 Shotaro I - Seagull Support

Shotaro I - Seagull Support

    Member

  • Moderators
  • 421 posts
  • LocationJapan

Posted 01 July 2012 - 04:33 PM

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.

#18 BumpaRoy

BumpaRoy

    Member

  • Members
  • PipPip
  • 20 posts

Posted 02 July 2012 - 05:01 AM

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.

#19 BumpaRoy

BumpaRoy

    Member

  • Members
  • PipPip
  • 20 posts

Posted 02 July 2012 - 08:59 AM

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.

#20 BumpaRoy

BumpaRoy

    Member

  • Members
  • PipPip
  • 20 posts

Posted 02 July 2012 - 10:11 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users