c# - Running Topshelf service using ConfigureServiceInIsolation - Generic Host -


I am developing a very simple generic host solution that allows us to host assemblies in the form of windows services (ELA NSCsBIS) Will allow. I am coming in the following exceptions (similar to the comments given about the droo). I have to work this need I can hosting services in different AppDomains

"Type 'MyProject.WindowsServices.GenericHost.Program + & LT;> c__DisplayClass5'. Assembly 'MyProject.WindowsServices in .GenericHost, version = 1.0. 0.0, Culture = neutral, PublicKeyToken = null 'is not marked as serializable. "

I am using available from the download link on Topshelf 1.0 RC binary topshelf Home Am (topshelf-project.com). I have tried the latest build (29/07/2010), and Google makes avialable to download from code and gitub! I can not get any of these to work for me!

This is working in the NServiceBus library with an earlier version of TopShelf (DLL version 0.8.0.96). Some minor changes to what I used instead of down (HowToBuildService CreateServiceLocator) It worked for me with these old binaries, but I'd rather the latest code stick to take advantage of improvements or enhancements to any plans Code with

This is my code.

  static zero main (string [] arg) {ArgumentParser arguments = new argumentsParser (args); String configfile = path.comben (AppDomain.CurrentDomain.Base directory, Arguments.ServiceType.Assembly.ManifestModule.Name + ".config"); RunConfiguration cfg = RunnerConfigurator.New (X = & gt; {x.SetServiceName (arguments.ServiceName); x.SetDisplayName (arguments.DisplayName); x.SetDescription (arguments.Description); if (string.IsNullOrEmpty (arguments.UserName) ) {x.RunAsLocalSystem ();} else {x.RunAs (arguments.UserName, arguments.Password);} x.ConfigureServiceInIsolation & LT; GenericHost & gt; (c = & gt; {c.ConfigurationFile (configFile); c .Named (arguments.ServiceType CSS. & Quot; Test. ()); c. Hutobild Service (name = & gt; new generic host (arguments. service type)); c. started (Tc = & gt; Tc. Start ()); C. ;});}); Runners. Host (cfg, args); }  

Also note is that the class identified by my generichost class and arguments. Both service type, Marshalbeer Ozjal implement and I have also created these classes as serialjabs so that they can help see that it will help. It does not have these sections that are causing the problem though, it appears to be complaining about an anonymous type generated by the C # compiler for one or more of the lambda I configured.

Is anyone else seeing this problem by using ConfigureServiceInIolation ()? If not, does anyone know what I'm missing? Tell me if you need more information, e.g. Stack trace or more code.

If you are using only one service inside the host, then I will remove "insulation" This does not work right, but in the future version of Top Self (we are currently working on it) I think our best answer for this issue is at the top of the ability to drop files in the host and this That your service will automatically be automatically upgraded to a new appendix Rotate

I would say that it is not a compelling reason to belongs to a known issue and while using Inholaleshn, avoid the time. You can not Marshall the Lambda Expressions in the application domain barriers, so if the issue you are seeing is an important issue of the anesthesia, then I can see it in an effort to decide versus the release of the latest version I am [You can catch the latest god bits from here: - Warning, we are still under active development but I think all major bugs are now crushed].

If you want to discuss this further, posting on the MyStransit list can be easy, where all developers are watching:

I hope this will be helpful !


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -