2012-03-31 76 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

相關問題