Full Trust doesn't seem to work with WebMatrix Web.config file

1

Well, I've been told by my host that I need to enable FullTrust in my webmatrix website because I keep getting an error. (BUT, I have used a different host, and everything on my site works perfectly with them without modification). Anyway, I used the code my host suppllies in their KB, but that just generates a different error. So I looked up full trust on google and used about 5 different code samples to enable full trust but they all generate errors! even the ones on MSDN. And googling "Full Trust WebMatrix" doesn't really bring anything helpful either.

How can I successfully add full trust to a web.config file that is made using WebMatrix?

Any help is greatly appreciated!

Thank you

One of about 20 different errors:

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information:

Module

IIS Web Core

Notification

Unknown

Handler

Not yet determined

Error Code

0x8007000d

Config Error

Config File

\?\C:\Users\Jason\Documents\My Web Sites\OSF\web.config

Requested URL

http://localhost:40625/Default.cshtml

Physical Path

Logon Method

Not yet determined

Logon User

Not yet determined

Request Tracing Directory

C:\Users\Jason\Documents\IISExpress\TraceLogFiles\

Config Source: -1: 0:

More Information: This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.

If you see the text "There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined", this error is because you are running a .NET Framework 3.5-based application in .NET Framework 4. If you are running WebMatrix, to resolve this problem, go to the Settings node to set the .NET Framework version to ".NET 2". You can also remove the extra sections from the web.config file. View more information ยป

The web.config file:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <securityPolicy>
            <trust level="Full" />
        </securityPolicy>

        <defaultDocument>
            <files>
                <add value="Default.cshtml" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>
asp.net
iis
razor
config
webmatrix
asked on Stack Overflow Mar 30, 2011 by (unknown user) • edited Mar 30, 2011 by (unknown user)

1 Answer

0

securityPolicy or trust element in system.web element.

securityPolicy Element (ASP.NET Settings Schema)

trust Element (ASP.NET Settings Schema)

answered on Stack Overflow Mar 30, 2011 by takepara • edited Mar 30, 2011 by takepara

User contributions licensed under CC BY-SA 3.0