exePath must be specified when not running inside a stand alone exe.

Dec 25, 2011 at 2:52 PM

I am using VS2010/IIS 7.5 (integrated mode)/asp.net web application

I copied the contents of your app.config into my web.config.

The handler has been set up correctly because if I comment out the memcached code and just output some text, the handler works.

 

When I try to access the httpHandler, I get the error

"exePath must be specified when not running inside a stand alone exe."

The offending line is

protected static MemcachedClient MemcachedClient = new MemcachedClient();
 System.Configuration.ConfigurationManager.OpenExeConfigurationImpl(ConfigurationFileMap fileMap, Boolean isMachine, ConfigurationUserLevel userLevel, String exePath) +182762
   Smith.AMC.MemcachedClient..ctor() in D:\kode\Smith.AsyncMemcachedClient\Smith.AsyncMemcachedClient\MemcachedClient.cs:72
   MemCachedAsHttpHandler.synchttphandlerSet..cctor() in D:\Dropbox\VS2010\MyExamples\QuestpondSln\MemCachedAsHttpHandler\synchttphandlers.cs:48

 

Your .config file references memcached.config, but I did not see any such file in the download.

Is there some sample code I could download to help me get over this hurdle.

Thank you for your help.

 


Dec 25, 2011 at 5:00 PM

Hi Rahul,

The configuration file included in the download defines configuration sections: 

<configuration>

<configSections>

One of the exampled is using the configSource, but you do not have to do that you can simply just use an embedded version of the config, ie.

use:

<configuration>    <configSections>        <section name="smith.amc" type="Smith.AMC.Configuration.MemcachedClientConfiguration, Smith.AsyncMemcachedClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>

</configSections>

    <smith.amc socketpooltimeout="10" reconnectperiod="10" useudp="true" numberofsockets="25">        <servernodes>            <add hostname="127.0.0.1" tcpport="11211" udpport="11212" />        </servernodes>    </smith.amc>

</configuration>

I havent tried the memcached client in IIS 7.5, so it seems like there is a bug in the code.

You can try to use the alternative constructor where you pass in an MemcachedClientConfiguration configuration to the constructor, then I will work on a fix to make the default constructor work in IIS 7.5.

Just remember that the default no args constructor expects the config section in the web/app.config to be named smith.amc because its using the following in the default constructor:

ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None).GetSection("smith.amc"))

Let me know if the workaround fixed it for you.

Bjørn

Dec 25, 2011 at 5:10 PM


Hats off to you for responding to my question within hours on Christmas day. All I can say is, I have never seen anything quite like this.
Thank you so much.
I will try it now and let you know.



From: [email removed]
To: [email removed]
Date: Sun, 25 Dec 2011 09:00:33 -0800
Subject: Re: exePath must be specified when not running inside a stand alone exe. [asyncmemcached:284127]

From: bjornbouetsmith
Hi Rahul,
The configuration file included in the download defines configuration sections:
<configuration>
<configSections>
One of the exampled is using the configSource, but you do not have to do that you can simply just use an embedded version of the config, ie.
use:
<configuration> <configSections> <section name="smith.amc" type="Smith.AMC.Configuration.MemcachedClientConfiguration, Smith.AsyncMemcachedClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</configSections>
<smith.amc socketpooltimeout="10" reconnectperiod="10" useudp="true" numberofsockets="25"> <servernodes> <add hostname="127.0.0.1" tcpport="11211" udpport="11212" /> </servernodes> </smith.amc>
</configuration>
I havent tried the memcached client in IIS 7.5, so it seems like there is a bug in the code.
You can try to use the alternative constructor where you pass in an MemcachedClientConfiguration configuration to the constructor, then I will work on a fix to make the default constructor work in IIS 7.5.
Just remember that the default no args constructor expects the config section in the web/app.config to be named smith.amc because its using the following in the default constructor:
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None).GetSection("smith.amc"))
Let me know if the workaround fixed it for you.
Bjørn
Read the full discussion online.
To add a post to this discussion, reply to this email (asyncmemcached@discussions.codeplex.com)
To start a new discussion for this project, email asyncmemcached@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Dec 25, 2011 at 5:52 PM
Edited Dec 25, 2011 at 5:59 PM

Hi Rahul,

I have changed the MemcachedClient class so it should work in a web application now.

I have tested both within IIS and the ASP.NET development server.

I found a bug in the code because I implemented a simple test web project that proves it works, so thats nice :)

I have made a release with the bug fixes, so it should be available from the downloads section.

But feel free to download the source code and see how I implemented my test http handler.

Best regards and merry christmas :)

Bjørn

Dec 25, 2011 at 8:06 PM

Wonderful !

Thank you very much Bjorn.