[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mono-2.0-service ubuntu server 10.04



Hi Joe

When I try and run the service with mono, nothing happens, no output, nothing, I know it is not launching as it normally starts listening on a certain port. I gues plain old mono does not initiate the service startup procedure and that is why I have to use mono-service2. When I try monodis --assemblyref service.exe I get the following:

AssemblyRef Table
1: Version=2.0.0.0
	Name=mscorlib
	Flags=0x00000000
	Public Key:
0x00000000: B7 7A 5C 56 19 34 E0 89 
2: Version=6.2.3.0
	Name=MySql.Data
	Flags=0x00000000
	Public Key:
0x00000000: C5 68 7F C8 89 69 C4 4D 
3: Version=2.0.0.0
	Name=System
	Flags=0x00000000
	Public Key:
0x00000000: B7 7A 5C 56 19 34 E0 89 
4: Version=2.0.0.0
	Name=System.ServiceProcess
	Flags=0x00000000
	Public Key:
0x00000000: B0 3F 5F 7F 11 D5 0A 3A 
5: Version=2.0.0.0
	Name=System.Configuration.Install
	Flags=0x00000000
	Public Key:
0x00000000: B0 3F 5F 7F 11 D5 0A 3A 

All of the dlls for the above can be found in /usr/lib/mono/2.0/, except for MySql.Data.dll which is in the application directory. So it seemed like everything was there.  However when I tried monodis --assemblyref MySql.Data.dll I got the following:

AssemblyRef Table
1: Version=2.0.0.0
	Name=mscorlib
	Flags=0x00000000
	Public Key:
0x00000000: B7 7A 5C 56 19 34 E0 89 
2: Version=2.0.0.0
	Name=System.Transactions
	Flags=0x00000000
	Public Key:
0x00000000: B7 7A 5C 56 19 34 E0 89 
3: Version=2.0.0.0
	Name=System.Data
	Flags=0x00000000
	Public Key:
0x00000000: B7 7A 5C 56 19 34 E0 89 
4: Version=2.0.0.0
	Name=System
	Flags=0x00000000
	Public Key:
0x00000000: B7 7A 5C 56 19 34 E0 89 
5: Version=2.0.0.0
	Name=System.Configuration.Install
	Flags=0x00000000
	Public Key:
0x00000000: B0 3F 5F 7F 11 D5 0A 3A 
6: Version=2.0.0.0
	Name=System.Drawing
	Flags=0x00000000
	Public Key:
0x00000000: B0 3F 5F 7F 11 D5 0A 3A 
7: Version=2.0.0.0
	Name=System.Xml
	Flags=0x00000000
	Public Key:
0x00000000: B7 7A 5C 56 19 34 E0 89 

For some reason System.Data.dll is not present, I am not sure why this is not installed by default. All of the other dlls are present. From digging around I have found that it is installed via the libmono-system-data2.0-cil package. However even with this installed and all apparent dependencies satisfied I still get the same nondescript error when trying to run the service in debug mode via mono-service2.

I then added a Program class with a new void main so that I could try and run the app via plain mono. Now when I run it via plain mono it works and starts listening on the port. When I set the start class back to WindowsService I get the error with mono-service2 --debug and no output with mono. So I am not sure how to proceed or get more debug information, It still works when I add the libmono2.0-cil package, I am not sure what this package is for or why it fixes the issue. If I am unable to solve the cause of the problem I will be forced to use it, however it should not be neccessary given that all the referenced assemblies above are present with just the mono-2.0-service and system-data2.0-cil packages and their dependancies. Are there any logs I can check or turn on that could shed more light on the issue?

Thanks for all your help,
Gavin

--- On Fri, 11/6/10, Jo Shields <directhex@apebox.org> wrote:

> From: Jo Shields <directhex@apebox.org>
> Subject: Re: mono-2.0-service ubuntu server 10.04
> To: "Gavin Phaup" <gavin4p@yahoo.co.uk>
> Cc: ubuntu-mono@lists.ubuntu.com, debian-cli@lists.debian.org
> Date: Friday, 11 June, 2010, 15:10
> On Fri, 2010-06-11 at 12:12 +0000,
> Gavin Phaup wrote:
> > Hi Joe
> > 
> > The following is the contents of /usr/lib/mono/2.0/
> after installing just the mono-2.0-service package.
> > 
> > CustomMarshalers.dll   
>       System.Core.dll
> > gacutil.exe       
>       System.dll
> > I18N.dll       
>       System.Drawing.dll
> > I18N.West.dll       
>       System.EnterpriseServices.dll
> > Mono.Posix.dll       
>       System.Management.dll
> > Mono.Security.dll       
>   System.Security.dll
> > mono-service.exe       
>   System.ServiceProcess.dll
> > mscorlib.dll       
>       System.Transactions.dll
> > System.Configuration.dll     
> System.Xml.dll
> > System.Configuration.Install.dll 
> System.Xml.Linq.dll
> > 
> > As you can see mono-service.exe exists. The following
> is the list of the dependancies that where installed with
> mono-2.0-service package.
> > 
> > --\ Packages being automatically installed to satisfy
> dependencies (10)
> > ciA  binfmt-support       
>     +168kB  <none> 
>    1.2.18    
> > piA  cli-common         
>       +344kB  <none> 
>    0.7       
> > piA  libmono-corlib2.0-cil 
>    +2,679k <none> 
>    2.4.4~svn1
> > piA  libmono-i18n-west2.0-cil  +225kB 
> <none>     2.4.4~svn1
> > piA  libmono-posix2.0-cil     
> +303kB  <none> 
>    2.4.4~svn1
> > piA 
> libmono-security2.0-cil   +418kB 
> <none>     2.4.4~svn1
> > piA  libmono-system2.0-cil 
>    +4,510k <none> 
>    2.4.4~svn1
> > piA  mono-2.0-gac       
>       +147kB  <none> 
>    2.4.4~svn1
> > piA  mono-gac         
>         +135kB  <none> 
>    2.4.4~svn1
> > ciA  mono-runtime       
>       +3,379k <none> 
>    2.4.4~svn1
> > 
> > I dont have any other services to test mono-service2
> with, however I managed to fix the problem by installing
> libmono2.0-cil package. Should this be a dependancy of the
> mono-2.0-service package? If it should not be neccesary I
> would prefer not to use it as the libmono2.0-cil package has
> a lot of dependancies and with this being a customer's
> production server I would like to install as little as
> possible.
> 
> It looks like mono-service simply gives incredibly
> unhelpful errors when
> it fails.
> 
> If your *APP* has any required assemblies missing, then
> mono-service
> reports that it's missing.
> 
> For example:
> 
> $ mono hello.exe 
> 
> ** (hello.exe:8946): WARNING **: The following assembly
> referenced
> from /tmp/hello.exe could not be loaded:
>  
>    Assembly:   System.Windows.Forms 
>   (assemblyref_index=0)
>      Version:    2.0.0.0
>      Public Key: b77a5c561934e089
> The assembly was not found in the Global Assembly Cache, a
> path listed
> in the MONO_PATH environment variable, or in the location
> of the
> executing assembly (/tmp/).
> 
> 
> ** (hello.exe:8946): WARNING **: Could not load file or
> assembly
> 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089' or one of its
> dependencies.
> The entry point method could not be loaded
> 
> $ mono-service2 --no-daemon hello.exe 
> 
> Unhandled Exception: System.IO.FileNotFoundException: Could
> not load
> file or assembly 'mono-service, Version=2.0.0.0,
> Culture=neutral,
> PublicKeyToken=0738eb9f132ed756' or one of its
> dependencies. The system
> cannot find the file specified.
> File name: 'mono-service, Version=2.0.0.0,
> Culture=neutral,
> PublicKeyToken=0738eb9f132ed756'
>   at (wrapper xdomain-invoke)
> System.AppDomain:CreateInstanceAndUnwrap
> (string,string,bool,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo,object[],System.Security.Policy.Evidence)
>   at (wrapper remoting-invoke-with-check)
> System.AppDomain:CreateInstanceAndUnwrap
> (string,string,bool,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo,object[],System.Security.Policy.Evidence)
>   at MonoServiceRunner.Main (System.String[] args)
> [0x00000] in
> <filename unknown>:0 
> 
> 
> So I think it's the app missing things, nothing to do with
> mono-service
> itself.
> 
> Check the app's dependencies via "monodis --assemblyref
> app.exe" - or
> simply try running it without mono-service and see what
> explodes.
> 





Reply to: