Converting Commander To .net Sdk Follow

0
Avatar
Legacy Poster

 am getting the following error "mixed mode assembly is built against v2.0.50727 of the runtime and cannont be loaded in the 4.0 runtime without additonal configuration info"

 

Here is the code being executed.  I am new to Bartender and I am coverting a vb6 app running on ver7.75 to vb.net version 10.1.sr3

The code errors on the btEngine.start statement

 

Public Sub PrintLabels(byref LableTemplate as string,byref Printername as steing, byref nbrofcopies as integer,byref lblformat as string)

 

Using btEngine as new Engine(true)

    btEngine.start()

 

   dim strFormat as string = nothing

 

   Select Case lblformat

        Case "lblvend.btw"

            strformat = "c:\lable\lblvend.btw"

        Case "lbllocn.btw"

            strformat = "c:\label\lbllocn.btw"

        Case "lblptag.btw"

            strformat = "c:\lable\lblptag.btw"

  End Select

 

 Dim btFormat as LabelFormatDocument = btEngine.Documents.Open(strFormat)

 

bt.format.printsetup.identicalcopiesoflabel = nbrofcopes

 

Dim tf as Seagull.Bartender.Print.Database.Textfile = new Seagull.Bartender.Print.Database.Textfile(btFormat.DatabaseConnections(0).Name)

tf.FileName = fromprocessor.stroutputfilepath & "\" & frmProcessor.mstrtextfile

btFormat.DatabaseConnections.SetDatabaseConnection(tf)

 

btFormat.Print

 

btFormat.Close(SaveOptions.DoNotSaveChanges)

 

btEngine.Stop()

 

End Using

 

End Sub

 

 

I am assuming if I have the data to be printed (lblTemplate), the Nbroflabels to print (nbrofcopies), labelformat(lblformat) and the printer (PrinterName or could I set the default printer and not pass the printername) I could pass these params to the print engine and it would print.  Is this true?

 

3 comments

0
Avatar
Legacy Poster
Comment actions Permalink

I tried changing the app.config file to <startup useLegacyV2RuntimeActivationPolicy="true">

Now getting a different error.  Will bartender SDK version 10.1  run on .net framework 4.5

 

Error I get is "Could not load file or assembly 'Seagull.Bartender.Print, Version 10.1.3.1, culture=neutral or one of its dependencies.  An attempt was made to load a program with an incorrect format

0
Avatar
Canguita
Comment actions Permalink

Hello,

 
What version of Visual Studio are you running?
 
Have you build the application as x86 build in your project?
 
When installing BarTender, if you also selected to install the .NET SDKs, you will see a set of BarTender .NET SDK examples under “All Programs > BarTender 10.0 > BarTender .NET SDKs”. 
Are you able to run these samples?
 
Have you added the Seagull.BarTender.Print Reference in Visual Studio?
 
Thanks.
0
Avatar
Legacy Poster
Comment actions Permalink

Carlos

 

I was able to get the application running a couple of days ago using X86 and adding the Seagull BarTender.Print reference.  Had to point to .Net Framework 3.5 also.

Thanks for your response

Please sign in to leave a comment.