log4net.dll and PInvoke (urgent)

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
6/29/2006 11:40:19 PM
Gravatar
Total Posts 4

log4net.dll and PInvoke (urgent)

My web site is off-line because microsoft changes the security level from Full trust to Medium trust for the .net application in hosting.

I don't know what this means. After my protest they say to me the problem is related to log4net.dll because it use the PInvoke.

What I can do? I have to dismiss the mojoportal? Please help me.

I have enabled the debug info on my site so you can check the exception message.

Bye. Eraldo Corti.

(http://www.nabbirra.net)

6/30/2006 3:24:34 AM
Gravatar
Total Posts 18439

Re: log4net.dll and PInvoke (urgent)

Hi Eraldo,

I'm sorry to hear you are having this difficulty.

I don't think Microsoft did that, I think your hosting company did that and they can easily change it back to full trust for your site or you can easily find a host that does not enforce partial trust.

Partial trust is very restrictive. It does not allow the use of System.Reflection (amoung other things) which is used in a number of places in mojoportal and in NeatUpload.

There is no use of P/Invoke in log4net or anywhere else in mojoportal that I'm aware of.

The issue of hosts enforcing partial trust has come up before and I have been thinking about how we could make mojoportal work in that configuration but I have no immediate solution for you.

The problem is your host changed its security policy to a more strict policy. If it were me I would find a host that does not do that.

Joe
6/30/2006 3:54:52 AM
Gravatar
Total Posts 18439

Re: log4net.dll and PInvoke (urgent)

This page lists the things not allowed at each trust level.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/THCMCh09.asp

To get mojoPortal to work in partial trust we would have to remove or disable all use of System.Reflection.

In branches/2.1 I have already removed most use of relflection in creating the log4net log object

Before the syntaxt was like this using reflection:
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

and now its like this:
private static readonly log4net.ILog log
            = log4net.LogManager.GetLogger(typeof(RSSFeed));

But theses changes have not been released yet (until later this weekend) so the only way to get them right now is from svn which may also require use of db upgrade scripts since there are changes since the last release. Be very sure to back up your site and your db before you try this.

I'm not sure this will completely solve the problem of partial trust. You could try this and it may still give the error, I don't know.

More recently, for use of 3rd party web parts, I use Reflection to loop through assemblies in the bin to find installed web parts. This may not raise an error if you don't use this feature though, I'm not sure.
6/30/2006 4:08:35 AM
Gravatar
Total Posts 4

Re: log4net.dll and PInvoke (urgent)

I start to use program in 1983 when I was 13, using a Commodore 64, I like it so much I go bad to school but this way I start to work and to have money back since 1990.

Today I have 3 childs, lovely wife, I work as C++ and C# programmer and I was an homebrewer, until 3 days ago I also have a nice website, made with mojo, with 800 contacts each months.

I have no time to spend in compilation at home. So my site is simply dead.

I'm starting to think the computer are bad.

6/30/2006 1:49:24 PM
Gravatar
Total Posts 18439

Re: log4net.dll and PInvoke (urgent)

I think it is bad that your hosting company changed their security policy and broke your site which was working fine. It would be different if they told you ahead of time but if they break your site with their change and refuse to fix it I would never do business with them again. There are plenty of web hosts for asp.net that do not enforce medium trust.

I have seen your site it looked very nice. You could get it back online at another host.
7/10/2006 10:30:06 AM
Gravatar
Total Posts 18439

Re: log4net.dll and PInvoke (urgent)

Glad to see your site is back online!

http://www.nabbirra.net/

Cheers,

Joe
7/10/2006 10:04:56 PM
Gravatar
Total Posts 4

Re: log4net.dll and PInvoke (urgent)

Yes, I won my battle against the provider. I told them they cannot shut off my site without to inform me. So they moved my site on other server.

Thanks for the interest

 

Bye. Eraldo.

7/11/2006 4:32:30 AM
Gravatar
Total Posts 18439

Re: log4net.dll and PInvoke (urgent)

Glad they helped you out! I am working on making it possible to run mojoportal in Medium trust and hope to have this possible in the next release (2.1.1).

I think your site is using a fairly old version of mojoportal so upgrading will require a number of steps including probably changes to your custom skin. So if you decide to upgrade it will be best to get it working on a local machine before uploading to your host. The 2.1.1 release will probably happen within the next 2-3 weeks.

Cheers,

Joe
You must sign in to post in the forums. This thread is closed to new posts.