2012-03-31 77 views
0

我正在使用.Net/C#脚本上传XLS文件,然后转储到SQL SERVER中。如何编译中等信任的ASP.NET 2.0应用程序

它在本地服务器上运行良好,但不共享主机空间。主机说

“看来你在这个应用程序中使用完全信任,我们支持共享服务器上的中等信任,由于这个原因你得到这个错误信息。请重新编译中等信任的应用程序,然后检查它。 “

我问他们如何重新编译它中等信任,但他们要求我搜索谷歌,我没有找到任何帮助。

我应该改变web.config中的东西吗?

回答

0

改变你的webconfig文件中的设置..

<system.web> 
    <trust level="Medium" originUrl="" /> 
0

ASP.NET Web applications to run in medium trust. If you host multiple applications on the same server, you can use code access security and the medium trust level to provide application isolation. By setting and locking the trust level in the machine-level Web.config file, you can establish security policies for all Web applications on the server. Running at medium trust with ASP.NET version 2.0 is easier than with ASP.NET version 1.1 because when using ASP.NET 2.0, you have access to Microsoft SQL Server databases at medium trust. Medium trust still provides a constrained environment for isolating applications from one another and from shared server resources. Medium trust applications have no registry access, no event log access, and no ability to use reflection. Web access is limited to the network address that you define in the <<trust/>> element, and file system access is limited to the application's virtual directory hierarchy. If medium trust policy is too restrictive, you can create and use a custom policy file.

更多看到一个链接http://msdn.microsoft.com/en-us/library/ff648344.aspx

相关问题