views:

28

answers:

2

Hi,

I'm building an ASP.net mvc app, and am having some problems getting ELMAH deployed using xml logging to a medium trust server, though it works fine on my local machine. It keeps getting a 404 error.

The problem might be that the host doesn't allow relative filepaths, so the "~/App_Data" doesn't work for logging. I switched that to:

logPath="\\Something\Something\ID\www.website.com\web\content\App_Data"

in the web.config. The syntax might be completely off, but I've tried a few variations and none of them worked.

I subsequently found this question and added the recommended code to my web.config, but still no luck. Does anyone know how to get ELMAH to work on medium trust?

Thanks!

A: 

The asp.net worker process (or the aspnet user) has minimum rights to write into the filesystem. Try a place like c:\temp where everybody can write files. After this check and set access rights for aspnet user.

Christian13467
This is in a shared hosting environment, so the above log path is the filepath to write something into the filesystem (I write some other files successfully in the app, but the syntax might be different because this is the web.config file versus c# code).
Solomon
A: 

It turned out that the ELMAH.dll was calling SQLite, which isn't allowed under medium trust, and was causing ELMAH to fail when deployed to medium trust. I needed to download the source code for ELMAH and re-build it without the reference to SQLite. It is now working. Yay!

Solomon