Web Store + NeatUpload in Medium Trust

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

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.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
9/28/2009 8:45:11 AM
Gravatar
Total Posts 25

Web Store + NeatUpload in Medium Trust

Hi Joe,

I have recently been trying to get a simple 2 product cart going but have ran into the following error when trying to add or edit a product.
I am running in medium trust

2009-09-28 06:42:57,771 ERROR mojoPortal.Web.mojoBasePage - 209.12.156.211-en-US - /enforcer/WebStore/AdminProductEdit.aspx?pageid=2&mid=4&prod=501afda8-98da-40b4-b810-0789bd6e2300

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)

at System.Security.CodeAccessPermission.Demand()

at System.IO.Path.GetTempPath()

at Brettle.Web.NeatUpload.FilesystemUploadStorageProvider.GetDefaultTempDirectory()

.

. //Cleaned.....

.

Demand

The type of the first permission that failed was:

System.Security.Permissions.EnvironmentPermission

The Zone of the assembly that failed was:

MyComputer

.

9/28/2009 8:54:27 AM
Gravatar
Total Posts 18439

Re: Web Store + NeatUpload in Medium Trust

Please see the Medium Trust documentation. NeatUpload can't be used in Medium Trust and must be disabled. The easy way to disable it is to rename the Web.config to Web.fulltrust.config and rename the Web.mediumtrust.config to Web.config

Hope it helps,

Joe

9/28/2009 9:00:41 AM
Gravatar
Total Posts 25

Re: Web Store + NeatUpload in Medium Trust

I should say that I did a checkout of SVN.
I built the mojoportal.sln
I copyied over the mojoportal.data from MySQl from both the site and the web store
I renamed the mediumtrust to web.config and renamed the other to web.fulltrust.config
I tried to delete the Brettle.Web.*.dll's but got errors and had to put them back.

I publish to my hosting company and all seemed to work untill I try to ad or edit a product in the web store.

-Joe

9/28/2009 12:04:32 PM
Gravatar
Total Posts 25

Re: Web Store + NeatUpload in Medium Trust

Can some one confirm that the Web Store can run in medium trust?

 

 

9/28/2009 12:18:32 PM
Gravatar
Total Posts 18439

Re: Web Store + NeatUpload in Medium Trust

I can't think of a reason it would not work in medium trust, though for any serious ecommerce I would use a dedicated server not shared hosting and on a dedicated server you can use full trust.

I assume the problem is because you've deployed some funky build you made yourself.

When producing a build from svn you should not then copy in dlls from another download, you should compile it for the db you are using by setting correct project references in Visual Studio, then you can test and debug it against the database of your choice in Visual Studio.

You can test  medium trust on your own machine using Visual Studio by uncommenting this in Web.config system.web section.

<trust level="Medium" originUrl="" />

You cannot produce a good package using the Visual Studio publish feature if thats what you've done. I use UnleashIt.

Hope it helps,

Joe

9/28/2009 12:22:27 PM
Gravatar
Total Posts 25

Re: Web Store + NeatUpload in Medium Trust

That sounds about like what I did.

I will backup and redo my SVN build with the correct VS settings and publish with the Unleash-It instructions.

Thank's joe

 

-Joe

9/29/2009 10:45:11 AM
Gravatar
Total Posts 25

Re: Web Store + NeatUpload in Medium Trust

Joe,

Following the instructions for deployment using Unleash-it and setting all the build refs to MySql i was able to run localy, but when I pushed the site to production after deleting the files mentioned as garbage, obj dir ect.... I get the following error when running the setup page

Could not find a part of the path 'D:\...Path...\Data\Sites\1\systemfiles\test.config'

 

I deleted all the files as you said under the systemfiles folder.

Any ideas? I can just add the file as a blank file so it finds it but is this going to cause other issues?

 

 

9/29/2009 10:55:29 AM
Gravatar
Total Posts 18439

Re: Web Store + NeatUpload in Medium Trust

If the /Data/Sites/1/systemfilesfolder does not exist then create it, if it does exist then it does not have write permissions that it needs. It tries to create that test.config fle tomake sure it can write.

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