Remoting has never been able to read the configuration file since it became a Windows service, one of the possible reasons.

Source: Internet
Author: User
Of course, before you can read the configuration file and start the channel, make sure that your configuration file is correct. The correct format for dynamic configuration of remoting is:

< Configuration >
< System. runtime. remoting >
< Application >
< Service >
< Wellknown Type = "Happyweb. BLL. publishnewsclass, happyweb. BLL" Objecturi = "Happyweb. BLL. publishnewsclass"
Mode = "Singleton"   />
< Wellknown Type = "Happyweb. BLL. memberlogincheck, happyweb. BLL" Objecturi = "Happyweb. BLL. memberlogincheck"
Mode = "Singleton"   />
< Wellknown Type = "Happyweb. BLL. publishpartsnews, happyweb. BLL" Objecturi = "Happyweb. BLL. publishpartsnews"
Mode = "Singleton"   />
</ Service >
< Channels >
< Channel Ref = "TCP" Port = "9999" >
< Serverproviders >
< Formatter Ref = "Binary" Typefilterlevel = "Full"   />
</ Serverproviders >
</ Channel >
</ Channels >
</ Application >
</ System. runtime. remoting >
</ Configuration >

The Type format is <namespace>. <class>, <Assembly>

The service cannot be started. System. runtime. remoting. remotingexception: "system. Io. filenotfoundexception: the specified file cannot be found. (Exception from hresult: 0x80070002)
In system. configserver. runparser (iconfighandler factory, string filename)
In system. configtreeparser. parse (string filename, string configpath, Boolean skipsecuritystuff)
In system. runtime. remoting. remotingconfighandler. loadconfigurationfromxmlfile (string filename) ", The. config file named xxx.windowsservice.exe. config cannot be read ".
In system. runtime. remoting. remotingconfighandler. loadconfigurationfromxmlfile (string filename)
In system. runtime. remoting. remotingconfighandler. doconfiguration (string filename, Boolean ensuresecurity)
In system. runtime. remoting. remotingconfiguration. Configure (string filename, Boolean ensuresecurity)
In XXXX. windowsservice. srvmain. onstart (string [] ARGs)
In system. serviceprocess. servicebase. servicequeuedmaincallback (object state)

Because my software server is first used as an applicationProgram, And then switch to the Windows service,

So I can confirm myCodeYes. The remoting configuration is also correct.

Later I used a Windows File Reading tool and found a record in it.
Createfile
C: \ windows \ system32 \ happyweb.windowsservice.exe. config
Name not found

I guess whether the configuration file is to be put here.

However, I cannot find such results on Google,

The prompt on the internet is that the config file must be put together with the EXE file,

I think it may be an example. If you encounter the same strange thing, I hope this will help you.

In addition, I hope that experts can explain why.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.