Compiling MVC application for Medium Trust Level
Asked Answered
C

1

8

I am trying to deploy an ASP.NET MVC4 site to a HostGator shared windows host. I am running into some trouble when their technical support tells me I have to compile my application for medium security.

As far as I can tell the only way to set the trust level for an application is to set the <trust level="Medium"> either in machine.config or web.config. Am I wrong in assuming this, is there another way to compile my application for medium trust?

based on my initial assumption, and the information i found on this page I added the trust level to my web.config:

By default, Web applications run with full trust and have unrestricted permissions. To modify code access security trust levels in ASP.NET, you have to set a switch in the Machine.config file or the application-level Web.config file and configure the application as a partial-trust application. I put the trust level in my web.config and get this error message form the host:

Parser Error Message: This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using from an inherited configuration file.

However HostGator still insist that i compile for medium trust, does any one have any advice for me on this subject?

Communard answered 3/2, 2013 at 20:31 Comment(0)
I
1

You are correct. You can change you web.config's trust setting to Medium. However, you might have some assemblies that don't work in partial trust mode (such as some IoC containers).

The only way to know for sure is to run it and find out.

Incised answered 8/7, 2013 at 10:16 Comment(4)
We ended up going with another hosting provider. However the host was not the issue, and it's been so long I cannot properly recall how we got around this issue. Thanks for the response.Communard
@Matt I am running into the same problem, setting trust to medium is causing another errorChinachinaberry
@yzwboy I have been away on holiday and I've just seen this. Have you created a question regarding your problem?Incised
@Matt I figured out my problem, My hosting provider doesn't allow full trust, and Ninject needs full trust to operate. So I switched my hosting provider to one that allows full trust and that fixed it. ThanksChinachinaberry

© 2022 - 2024 — McMap. All rights reserved.