WebPart Installation problem w Medium Trust on XP IIS

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/20/2008 11:53:17 AM
Gravatar
Total Posts 31

WebPart Installation problem w Medium Trust on XP IIS

hi Joe,

I am trying to develop a WebPart to install into mojo but am having a problem i can't seem to get past.

I have mojo running in both dev (xp+iis) & server (win2003 + iis).  I compiled a DLL to drop into the bin directory.  When I open the WebPart Installation page in Admin on my dev box, I get the error "the site seems to be running in medium trust".  I've checked a number of different .config files (machine.config, web.config, etc) but can not find any reference to set it to medium.  I double-checked ntfs permissions & everything looks ok.  I also added: <trust level="Full"/> to the mojo web.config file & still no luck :( 

However, dropping the dll into the bin directory on my server, everything works happily. 

Any thoughts?  Things I should look into?

1/20/2008 12:36:49 PM
Gravatar
Total Posts 18439

Re: WebPart Installation problem w Medium Trust on XP IIS

Hi,

The problem is that reflection is not allowed at all in medium trust.

The webpart would have to be loaded some other way than by reflection. So the user control approach to web parts might be more medium trust friendly.

Hope it helps,

Joe

1/20/2008 12:39:40 PM
Gravatar
Total Posts 18439

Re: WebPart Installation problem w Medium Trust on XP IIS

If this is a development machine or a machine you have full control over then you can set it to full trust. If you're in a medium trust hosted environment there is not much you can do but switch hosts or accept the tradeoffs of medium trust.

trust level can be set in Web.config but in hosting is usually set in machine.config

Hope it helps,

Joe

1/20/2008 12:46:16 PM
Gravatar
Total Posts 31

Re: WebPart Installation problem w Medium Trust on XP IIS

I understand that webparts can't be loaded in medium trust - I want both machines to run in Full

I'm having problems setting the machine (development) to FULL trust, even with <trust level="FULL"> in the web.config.

I have control over both workstation & server & I want them to be running in full trust- and they seem to be - according to the settings, but mojo doesn't seem to recognize it.  Or I'm just missing something.

Sorry, just looking for some pointers to help me diagnosis what the problem is.

Thanks,
Chris

1/20/2008 12:52:18 PM
Gravatar
Total Posts 18439

Re: WebPart Installation problem w Medium Trust on XP IIS

ok well it must be machine.config because if machine.config is set to medium then setting to full in web.config won't work.

best to comment it out in web.config and track it down in machine.config

also is this IIS 6 or did you install IIS7?

be aware if you have multiple versions of .NET on the machine they each have their own machine.config, make sure you are looking in the 2.0 .NET folder

on my machine I have folders for 1.1 framework up to 3.5 and each is in different folders

2.0 on my machine is in:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG folder

Hope it helps,

Joe

1/20/2008 1:10:43 PM
Gravatar
Total Posts 18439

Re: WebPart Installation problem w Medium Trust on XP IIS

Also be aware that the error message is just telling you the most likely cause of the problem is trust level, but you could see that message in other cases too.

Its just catching a ReflectionTypeLoadException and showing that message, so if some other reason is causing that error it could be sending you on the wrong path for troubloeshooting.

Reason I mention this is its unlikely on xp you are in medium trust unless you explicitly set it that way.

Hope it helps,

Joe

1/20/2008 1:13:36 PM
Gravatar
Total Posts 18439

Re: WebPart Installation problem w Medium Trust on XP IIS

One more possibility is if your machines are on a domain and trust level is being enforced by group policy I don't think you can solve it with machine.config on the machines.

Hope it helps,

Joe

1/21/2008 10:10:49 AM
Gravatar
Total Posts 31

Re: WebPart Installation problem w Medium Trust on XP IIS

Hi Joe, thanks for the suggestions.

As for directories, I also have up to 3.0 on my workstation, 2.0 on the server.  Not sure about IIS 7.0 although I don't think it's installed (not sure how to check off hand).

Both machines are on a domain and there may be something in Group Policy because the machines are in different OU's. I'll look into that.

 

Unfortunately, I'm under time contraints & already have SiteModuleControl(s) working so I am going to continue with that route for now.

Thanks

Chris

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