2011-09-30 61 views
2

我一直在使用Visual Studio 2010中創建了一個WCF服務,當我嘗試運行的服務,我得到以下錯誤在Visual Studio中運行WCF服務時,2010

文件名獲得System.NotSupportedException :/// H:\ Personal \ Visual Studio 2010 \ Projects \ WPFBrowser \ DatabaseService \ bin \ Debug \ DatabaseService.dll' ---> System.NotSupportedException:嘗試從網絡位置這會導致程序集 在先前版本的.NET Framework中被沙盒化。此.NET Framework的 版本默認情況下不啓用CAS策略,因此此加載可能很危險。如果此負載不適用於沙盒 ,請啓用loadFromRemoteSources開關。有關更多信息,請參閱 http://go.microsoft.com/fwlink/?LinkId=155569
在System.Reflection.RuntimeAssembly._nLoad(的AssemblyName文件名, 字符串的代碼庫,證據assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark & stackMark,布爾throwOnFileNotFound, 布爾forIntrospection,布爾suppressSecurityChecks)在 System.Reflection.RuntimeAssembly.nLoad(的AssemblyName文件名,字符串 的代碼庫,證據assemblySecurity,RuntimeAssembly locationHint, StackCrawlMark & stackMark,布爾throwOnFileNotFound,布爾 forIntrospection,布爾suppressSecurityChecks)在 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(的AssemblyName 屁股emblyRef,證據assemblySecurity,StackCrawlMark & stackMark, 布爾forIntrospection,布爾suppressSecurityChecks)在 System.Reflection.Assembly.Load(的AssemblyName assemblyRef)在 Microsoft.Tools.SvcHost.ServiceHostHelper.LoadServiceAssembly(字符串 svcAssemblyPath)

我甚至嘗試設置

<configuration> 
    <runtime> 
    <loadFromRemoteSources enabled="true" /> 
    </runtime> 
</configuration> 

在app.config文件中,但問題依然存在。

任何幫助將不勝感激....

回答

1

將我的解決方案從網絡驅動器移到本地C:\並且它開始工作正常

1

我想你應該看看的: 「文件:/// H:\個人\的Visu ...」。爲什麼文件://? WCF服務應該包含在Visual Studio中的「developer iis」中。這應該導致類似於:「http:// localhost/abc ...」

相關問題