2012-10-02 45 views
6

當運行在TeamCity的一個MSpec打造一步我得到在球隊的城市記錄以下錯誤:爲什麼在TeamCity上運行MSpec時會出現NotSupportedException?

[Step 7/7] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit 
[17:07:13][Step 7/7] in directory: C:\TeamCity\buildAgent\work\726e90173bc65483 
[17:07:14][Step 7/7] 2012-10-02 17:07:14,471 [4332] ERROR JetBrains.TeamCity.Utils.Runtime.ParseUtil - Failed to load assembly from file c:\mspec\mspec.exe: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. 
[17:07:14][Step 7/7] System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. 
[17:07:14][Step 7/7] at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence) 
[17:07:14][Step 7/7] at System.Reflection.Assembly.LoadFile(String path) 
[17:07:14][Step 7/7] at JetBrains.TeamCity.Utils.Runtime.ParseUtil.LoadAssembly(String value) in c:\BuildAgent\work\e6509710c0972c73\src\Utils\src\Runtime\ParseUtil.cs:line 110 

我所做的建議的修改的machine.config和MSpec配置文件,但它似乎沒有不幫幫我。

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

MSpec runner在Visual Studio本地正確運行的構建代理上本地引用編譯的DLL。任何人都可以解釋這個錯誤意味着什麼,以及我可以如何解決它?

+0

在您的TeamCity日誌中,我看到它記錄了'NUnitLauncher'是否正確? –

+0

您是否爲您的目標框架使用了正確的'mspec.exe'?你究竟在本地運行_命令行_?你如何從Visual Studio運行(使用TD.NET或ReSharper)? –

回答

7

你可以檢查mspec.exe或「編譯的DLL」的屬性,看看是否有security Unblock button。我有同樣的錯誤和解除阻止修復它。啓用loadFromRemoteSources沒有幫助。

+1

鏈接不工作,工作鏈接:http://allen-conway-dotnet.blogspot.se/2012/01/fixing-systemiofileloadexception-upon.html – Liedman

+0

謝謝!錯過了Unblock按鈕。 – rickythefox

相關問題