ASP.NET 2.0, AJAX, Medium Trust - HOW?

I recently deployed an ASP.NET AJAX site and it threw and error regarding security. I knew it had to be with AJAX.

I opened a support ticket and have been going back and forth for some time now and I am trying to find out if anyone on this forum has a .NET 2.0 Microsoft AJAX Enabled Site?

I was told the following from support.

1. You must use Medium Trust.
2. Directed to look at the following link
http://msdn2.microsoft.com/en-us/library/ms998341.aspx#paght000020_step

3. I followed the MSDN instructions and added the following line of code to my web.config.
<trust level="Medium" originUrl="" />

4. Now my site throws another error telling me that I cannot add <trust level="Medium" originUrl="" /> to my web.config because the machine.config setup by Jodo does not allow me to override this setting.

Anyone out there have a site running with ASP.NET 2.0 and AJAX. Please let me know what I have to do to get this running in the shared environment at medium trust.

Thank you,
Patrick
SURFThru.com
 
we have quite a few people using ajax.net on our servers in medium trust

Now my site throws another error telling me that I cannot add <trust level="Medium" originUrl="" /> to my web.config because the machine.config setup by Jodo does not allow me to override this setting.

remove this line :)
 
Re: IDisposable Causes The SecurityPermission Error

Stephen,

I went back into my code line by line ripping stuff out. I found out it was not AJAX. It happened before I hit the code.

It has to deal with the IDisposable interface in one of my classes.

When I call Dispose() I get System.Security.Permissions.SecurityPermission

This code on MSDN is what I have been using for some time.
http://msdn2.microsoft.com/en-us/library/system.idisposable.dispose.aspx

One line of code was the issue, and on a shared hosting environment it makes sense....

CloseHandle(handle);
[System.Runtime.InteropServices.DllImport("Kernel32")]

Now lets see if AJAX works for me.

Thanks,
Patrick
 
Back
Top