The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

The title quotes the output from my MobiLink server when I try to load a .NET assembly for error reporting.

Background story: Our customer was running SA11 and ML11, the .net assembly was referenced in the report_error event and we went along fine (it worked). When upgrading the customer to SA12 we also upgraded to ML12. Long story made short, the .net assembly did not work anymore, throwing the same error as above.

I thought it might be like this because the assembly was referencing some DLL in ML 11 so now I have

  • ErrorReporting.dll (tried to compile both for Any CPU and x64) targeting .Net Framework 2
  • My only references are iAnywhere.MobiLink.Script (from %SQLANY12%AssemblyV2) and System (C:WindowsMicrosoft.NETFrameworkv2.0.50727System.dll).
  • A synchronization setup where I have created an error to test reporting
  • Custom report_error script, Language .NET: ErrorReporting.MailReporting.ReportError
  • Signature of ErrorReporting.MailReporting.ReportError is

    public static void ReportError( ref int actionCode, int errorCode, string errorMessage, string user, string table)

I have installed 64-bit versions of SQL Anywhere 12 and MobiLink 12, but ml.net12.dll does not exist on my harddrive.

Can you help ?

EDIT: Update, I located a file named mldnet12.dll in /Bin64, copied this file to ml.net12.dll in the same folder and now I get a different error message.

E. 2012-11-08 10:59:38. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type 'ErrorReporting.MailReporting'
E. 2012-11-08 10:59:38. <1> [-10018] Error fetching connection script begin_connection_autocommit
E. 2012-11-08 10:59:38. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type 'ErrorReporting.MailReporting'
E. 2012-11-08 10:59:38. <1> [-10018] Error fetching connection script begin_connection

Does this mean something ?

Complete output from server log (start and dbmlsync request)
I. 2012-11-08 11:03:52. SQL Anywhere MobiLink Server Version 12.0.1.3769
I. 2012-11-08 11:03:52. 
I. 2012-11-08 11:03:52. Copyright © 2001-2012, iAnywhere Solutions, Inc.
I. 2012-11-08 11:03:52. Portions copyright © 1988-2012, Sybase, Inc. All rights reserved.
I. 2012-11-08 11:03:52. Use of this software is governed by the Sybase License Agreement.
I. 2012-11-08 11:03:52. Refer to http://www.sybase.com/softwarelicenses.
I. 2012-11-08 11:03:52. 
I. 2012-11-08 11:03:52. This server is licensed to:
I. 2012-11-08 11:03:52.     ---
I. 2012-11-08 11:03:52.     ---
I. 2012-11-08 11:03:52. Running Unrecognized Windows version Build 9200  on X86_64
I. 2012-11-08 11:03:52. Server built for X86_64 processor architecture
I. 2012-11-08 11:03:52. <Main> Local file for remote synchronization logs: 'mlsrv.mle'
W. 2012-11-08 11:03:52. <Main> [10032] Unable to open the file to store the client synchronization logs.  The filename is 'mlsrv.mle'
W. 2012-11-08 11:03:52. <Main> [10036] Client synchronization logs will be shown in the MobiLink server message log file or the MobiLink server messages window
I. 2012-11-08 11:03:52. <Main> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.DLL" into Domain "DefaultDomain"
I. 2012-11-08 11:03:52. <Main> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultDomain"
I. 2012-11-08 11:03:53. <Main> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.dll" into Domain "DefaultMobiLinkDNetScriptingDomain"
I. 2012-11-08 11:03:53. <Main> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultMobiLinkDNetScriptingDomain"
I. 2012-11-08 11:03:53. <Main> Loaded Assembly "ErrorReporting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" from "file:///B:/Workspace/MobiLink/ErrorReporting/ErrorReporting/bin/Debug/ErrorReporting.DLL" into Domain "DefaultMobiLinkDNetScriptingDomain"
I. 2012-11-08 11:03:53. <Main> This software is using security technology from Certicom Corp.
I. 2012-11-08 11:03:53. <Main> MobiLink server started
I. 2012-11-08 11:03:53. <Main> Started RTNotifier 'RTNotifier1'
I. 2012-11-08 11:04:09. <1> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.DLL" into Domain "DefaultDomain"
I. 2012-11-08 11:04:09. <1> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultDomain"
I. 2012-11-08 11:04:09. <1> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.dll" into Domain "DefaultMobiLinkDNetScriptingDomain"
I. 2012-11-08 11:04:09. <1> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultMobiLinkDNetScriptingDomain"
E. 2012-11-08 11:04:09. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type 'ErrorReporting.MailReporting'
E. 2012-11-08 11:04:09. <1> [-10018] Error fetching connection script begin_connection_autocommit
E. 2012-11-08 11:04:09. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type 'ErrorReporting.MailReporting'
E. 2012-11-08 11:04:09. <1> [-10018] Error fetching connection script begin_connection

EDIT2: Confirmed that C:Program FilesSQL Anywhere 12bin64 is in my PATH variable and SQLANY12 variable is C:Program FilesSQL Anywhere 12

asked 08 Nov '12, 04:25

OskarEmil's gravatar image

OskarEmil
431141831
accept rate: 50%

edited 08 Nov '12, 06:18


Thanks for reporting this long-standing problem!

I've fixed the plugin to use dnet instead of .net for the script language name, and to not add newlines to the script.

The issue number for this bug is 723981 and the fix is in build 12.0.1.3817, so will be in any future EBF releases with that build number or higher

I'm not sure how it worked for you in version 11. Perhaps someone hand edited the sync model file to make changes equivalent to those made by your UPDATE statements. The sync model code recognizes either .net or dnet when reading a sync model, but used the wrong one on output. As a possible workaround, you could try editing your model's mlsm file in a text or XML editor (eg. locate the user-script element for your handle_error script, fix the type attribute and delete the newlines around ErrorReporting.MailReporting.ReportError so that the user-script element is all on one line). If that works, it might last as long as you didn't change that script in the Events editor.

permanent link

answered 12 Nov '12, 19:56

Graham%20Hurst's gravatar image

Graham Hurst
2.6k11843
accept rate: 28%

edited 13 Nov '12, 15:06

Jeff%20Albion's gravatar image

Jeff Albion
10.7k171174

1

The newline is generated by the deployment wizard, it does not seem like I am able to edit it out from the model file.

Also, even if I change the type attribute to dnet the call to ml_add_lang_conn_script_chk

<user-script type=".Net" error="false">ErrorReporting.MailReporting.ReportError </user-script>

(13 Nov '12, 03:16) OskarEmil
Replies hidden

So the potential workaround doesn't work? Sorry about that. I guess whoever got it working in version 11 manually edited the generated SQL file before applying that to the consolidated, but didn't report the bug. FYI, editing the generated SQL file would be an alternative workaround to running the UPDATE statements, until an EBF with the fix is available.

(13 Nov '12, 11:48) Graham Hurst

Enter the script type as "dnet" instead of ".net"

  • Russ
permanent link

answered 08 Nov '12, 12:14

RussC_FromSAP's gravatar image

RussC_FromSAP
1.3k11030
accept rate: 20%

Not quite sure what you mean with that, are you talking about the server switches ? If so I am already doing that. This is my command for starting MLserver in the test environment.

mlsrv12 -c "DSN=***" -sl dnet(-MLAutoLoadPath=C:PathToErrorReportingbinDebug)

(09 Nov '12, 02:36) OskarEmil

The fact that you are getting the error "Cannot load DLL or shared object: 'ml.net12.dll' for Script Language: '.net'" means that you have somehow managed to get a row in the Mobilink system table that stores synchronization scripts with a language defined as ".net" instead of "dnet". That should not be possible using Sybase Central, or when using the standard SQL scripts to create synchronization scripts

ml_add_connection_script
ml_add_dnet_connection_script
ml_add_table_script
ml_add_dnet_table_script
...

I don't like your work around to create a ml.net12.dll. I don't know if that will work, and I know that file will never be updated if you apply a future v1201 EBF. Please delete this file, and then read the next paragraph.

To solve the "Cannot load DLL or shared object: 'ml.net12.dll' for Script Language: '.net'" error, execute the following SQL against the consolidated database :

update ml_script set language = 'dnet' where language = '.net';
commit;

Stop and start the ML Server, and see if that solves your problem.

Reg

Aside : I'm happy to try and figure out how you got into this state, but for now, I'd like to concentrate on getting you back to a working system.

permanent link

answered 09 Nov '12, 09:28

Reg%20Domaratzki's gravatar image

Reg Domaratzki
4.8k33269
accept rate: 41%

2

To elaborate on this a little, what's probably happening is that at startup the server sees your "-sl dnet" switch and so it loads mldnet12.dll and sets the MLAutoLoadPath you specified. Then, when it tries to run a script, it sees it's a ".net" script, so it tries to load ml.net12.dll using the default options. The ".net" script environment can't find any of your script classes because it doesn't have MLAutoLoadPath set.

(09 Nov '12, 09:43) Bill Somers

Thank you. I might be closing in on something now. How I got into this seems to originate from the deployment of the synchronization model. I found this in the deployment script for my consolidated database:

CALL ml_add_lang_conn_script_chk (
    'version1',
    'report_error',
    '.Net',
'
ErrorReporting.MailReporting.ReportError
',
    'FA16C87CD62289AAF625EC4D55A12214'
)

This remains present in the deployment script also if I remove the event and recreate it.

Same thing happens on a brand new synchronization model:

CALL ml_add_lang_conn_script_chk (
    'Testmodell',
    'report_error',
    '.Net',
'
ErrorReporting.MailReporting.ReportError
',
    'FA16C87CD62289AAF625EC4D55A12214'
)

I updated ml_script and got rid of the ml.net12.dll error, but there seems to be something more to it.

I start the server like this:

mlsrv12 -c "DSN=consolidated" -sl dnet(-MLAutoLoadPath=b:\Workspace\MobiLink\ErrorReporting\ErrorReporting\bin\Debug)

The server outpout looks fine:

I. 2012-11-12 13:57:34. SQL Anywhere MobiLink Server Version 12.0.1.3769
I. 2012-11-12 13:57:34. 
I. 2012-11-12 13:57:34. Copyright © 2001-2012, iAnywhere Solutions, Inc.
I. 2012-11-12 13:57:34. Portions copyright © 1988-2012, Sybase, Inc. All rights reserved.
I. 2012-11-12 13:57:34. Use of this software is governed by the Sybase License Agreement.
I. 2012-11-12 13:57:34. Refer to http://www.sybase.com/softwarelicenses.
I. 2012-11-12 13:57:34. 
I. 2012-11-12 13:57:34. This server is licensed to:
I. 2012-11-12 13:57:34.     Oskar Emil Skeide
I. 2012-11-12 13:57:34.     ***
I. 2012-11-12 13:57:34. Running Unrecognized Windows version Build 9200  on X86_64
I. 2012-11-12 13:57:34. Server built for X86_64 processor architecture
I. 2012-11-12 13:57:34. <Main> Local file for remote synchronization logs: 'mlsrv.mle'
I. 2012-11-12 13:57:35. <Main> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.DLL" into Domain "DefaultDomain"
I. 2012-11-12 13:57:35. <Main> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultDomain"
I. 2012-11-12 13:57:35. <Main> Loaded Assembly "iAnywhere.MobiLink.Script, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.Script.dll" into Domain "DefaultMobiLinkDNetScriptingDomain"
I. 2012-11-12 13:57:35. <Main> Loaded Assembly "iAnywhere.MobiLink, Version=12.0.1.3769, Culture=neutral, PublicKeyToken=a53f0c6f719e2641" from "file:///C:/Program Files/SQL Anywhere 12/Assembly/v2/iAnywhere.MobiLink.dll" into Domain "DefaultMobiLinkDNetScriptingDomain"
I. 2012-11-12 13:57:35. <Main> Loaded Assembly "ErrorReporting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" from "file:///b:/Workspace/MobiLink/ErrorReporting/ErrorReporting/bin/Debug/ErrorReporting.DLL" into Domain "DefaultMobiLinkDNetScriptingDomain"
I. 2012-11-12 13:57:35. <Main> This software is using security technology from Certicom Corp.
I. 2012-11-12 13:57:35. <Main> MobiLink server started
I. 2012-11-12 13:57:35. <Main> Started RTNotifier 'RTNotifier1'
(12 Nov '12, 08:05) OskarEmil
Replies hidden

The assembly looks like this (compiled for .net framework 2, Any CPU)

// Type: ErrorReporting.MailReporting
// Assembly: ErrorReporting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// Assembly location: B:\Workspace\MobiLink\ErrorReporting\ErrorReporting\bin\Debug\ErrorReporting.dll

using System;
using System.Net;
using System.Net.Mail;

namespace ErrorReporting
{
  public class MailReporting
  {
    public void ReportError(ref int actionCode, int errorCode, string errorMessage, string user, string table)
    { //Do stuff...

Still, I get this error from MobiLink server when I syncrhonize:

E. 2012-11-12 14:02:23. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type '

                        ErrorReporting.MailReporting'
E. 2012-11-12 14:02:23. <1> [-10018] Error fetching connection script begin_connection_autocommit
E. 2012-11-12 14:02:23. <1> [-10179] No Assembly in domain 'DefaultMobiLinkDNetScriptingDomain' contains type '

                        ErrorReporting.MailReporting'
E. 2012-11-12 14:02:23. <1> [-10018] Error fetching connection script begin_connection
(12 Nov '12, 08:05) OskarEmil

The ".Net" value in the ml_add_lang_conn_script_chk() call really seems wrong, cf. the definition of ml_add_dnet_connection_script in script syncsa.sql in the MobiLink\Setup directory, which clearly uses "dnet":

create procedure ml_add_dnet_connection_script( 
    in @version varchar( 128 ),
    in @event   varchar( 128 ),
    in @script  text )
begin
    call ml_add_lang_connection_script( @version, @event, 'dnet', @script )
end

(No, I surely ain't saying the error is on your side...)

(12 Nov '12, 08:16) Volker Barth

I could ask if MobiLink 11 used '.Net' as definition since this is a database upgraded from MobiLink 11 and SA 11 to ML 12 and SA12. However, I'm not sure if that is relevant as my ml_add_dnet_connection_script() procedure is identical to yours, the errors come from the synchronization model and appears in new syncrhonization models as well

(12 Nov '12, 08:29) OskarEmil

This is my workaround so far, thanks to Reg Domaratzki - Sybase for pinpointing me in the right direction.

From my comments on his answers I hope there is something useable for you, because it seems like both my errors come from errors in the deploymentscript generated by the synchronization model designer.

  1. Scripts are defined as '.Net' instead of 'dnet'
  2. A newline char is added to the assembly name in the call to ml_add_lang_conn_script_chk procedure, that causes a failure when MobiLink server is looking up the assembly in DefaultMobiLinkDNetScriptingDomain.

My report_error script currently looks like this in the designer:

?report_error?
ErrorReporting.MailReporting.ReportError

To get this to run I have to do this manually after deployment:

UPDATE ml_script SET script_language = 'dnet' WHERE script_language = '.Net'
UPDATE ml_script SET script = 'ErrorReporting.MailReporting.ReportError' WHERE script LIKE '%ErrorReporting.MailReporting.ReportError%'
COMMIT
permanent link

answered 12 Nov '12, 08:30

OskarEmil's gravatar image

OskarEmil
431141831
accept rate: 50%

Not sure if I should mark this as an answer or not since it's only a workaround ?

(12 Nov '12, 08:30) OskarEmil

I just ran a quick test with the v1201 ML Deployment Wizard in Sybase Central, and I wasn't able to generate the problems you describe (".Net" instead of "dnet" and extra newline). Are you interested in pursuing how you got to this state, or are you OK with the workaround?

(12 Nov '12, 11:23) Reg Domaratzki
Replies hidden
1

You can probably stop trying to repro this for now. I found some suspicious code in the plugin and pointed it out to one of the plugin guys. They are discussing it.

(12 Nov '12, 12:00) Bill Somers
1

As I have to manually tweak the ml_script table every time I deploy (creating a new model produced the same results) I would not mind spending some more time on getting to the final solution of this problem.

According to Bill Somers comment below I'll just wait a bit and see if the plugin guys come up with something.

(12 Nov '12, 16:02) OskarEmil
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×265
×53

question asked: 08 Nov '12, 04:25

question was seen: 1,256 times

last updated: 13 Nov '12, 15:06