Last post Apr 06, 2018 07:15 AM by knowledgist
Apr 19, 2017 07:21 AM|knowledgist|LINK
One of my web based application on .net was developed on full trust level environment for dedicated server hosting.
Now, I have to move my application on shared hosting who does not provide the full trust level for my application and assemblies using in the application.
what changes required in either web.config or my application to convert the full trust level into the medium trust level.
Thanks in advance.
Apr 19, 2017 08:32 AM|raju dasa|LINK
medium trust not only require change in web.config but also might be to your application.
check these site:
Apr 19, 2017 08:40 AM|knowledgist|LINK
Thanks for your reply.
Can you please be more specific that what kind of change I need to do in my coding and web.config file.
Apr 20, 2017 02:44 AM|Cathy Zou|LINK
To place your website in to Medium Trust you need to place the code below in to the 'configuration\system.web' section of your website web.config file:
<trust level="Medium" />
Secondly. There some Medium trust restrictions you need to note:
Many application hosting service providers run applications in the ‘Medium trust’ level. The main constraints placed on Medium trust Web applications are:
Iron Speed Designer does not support .NET Framework 4.0/4.5 web site running in Medium Trust. To run in Medium Trust, convert the web site to a web application.
The MySQL database is not supported in .NET Framework 4.0 running under Medium Trust.
OleDbPermission is not available. This means you cannot use the ADO.NET managed OLE DB data provider to access databases. However, you can use the managed SQL Server provider to access SQL Server databases.
EventLogPermission is not available. This means you cannot access the Windows event log.
ReflectionPermission is not available. This means you cannot use reflection.
RegistryPermission is not available. This means you cannot access the registry.
WebPermission is restricted. This means your application can only communicate with an address or range of addresses that you define in the <trust> element.
FileIOPermission is restricted. This means you can only access files in your application's virtual directory hierarchy. Your application is granted Read, Write, Append, and PathDiscovery permissions for your application's virtual directory hierarchy.
You are also prevented from calling unmanaged code or from using Enterprise Services.
For more information. you could refer to the following links.
May 10, 2017 06:54 AM|knowledgist|LINK
Thanks for response Cathy,
Well, I found a way. Once I placed the following lines of code in web.config:
<trust level="Medium" />
My site was stopped working. What I did, I just removed those DLLs and lines of code from web.config which runs on full trust level only.
Mar 28, 2018 08:36 AM|Samer.Arja|LINK
i am facing same problem
how can i solve this problem
which dll file i have to delete
and which lines of web.config i have to delete
please help me with this
Apr 06, 2018 07:15 AM|knowledgist|LINK
You need to remove thrid party DLLs / controls if you are using in your project.