2012-10-02 29 views
6

Khi chạy một MSpec xây dựng bước trong TeamCity Tôi nhận được lỗi sau đây trong các bản ghi đội bóng thành phố:Tại sao tôi nhận được NotSupportedException khi chạy MSpec trên TeamCity?

[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 

tôi đã thực hiện việc sửa đổi đề nghị với machine.config và tập tin cấu hình MSpec, nhưng nó dường như không Cứu giúp.

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

Á hậu MSpec tham chiếu DLL được biên dịch cục bộ trên tác nhân xây dựng chạy chính xác cục bộ trong Visual Studio. Bất cứ ai có thể giải thích những gì lỗi này có nghĩa là và làm thế nào tôi có thể đi về giải quyết nó?

+0

Trong nhật ký TeamCity của bạn, tôi thấy nó ghi nhật ký 'NUnitLauncher' đúng không? –

+0

Bạn có đang sử dụng đúng 'mspec.exe' cho khung được nhắm mục tiêu của mình không? Làm thế nào chính xác là bạn đang chạy cục bộ _từ dòng lệnh_? Làm thế nào để bạn chạy từ Visual Studio (sử dụng TD.NET hoặc ReSharper)? –

Trả lời

7

Bạn có thể kiểm tra các thuộc tính của mspec.exe hoặc "DLL đã biên dịch" để xem liệu có security Unblock button hay không. Tôi đã có lỗi tương tự và bỏ chặn cố định nó. Bật loadFromRemoteSources không giúp ích gì.

+1

Liên kết không hoạt động, liên kết hoạt động: http://allen-conway-dotnet.blogspot.se/2012/01/fixing-systemiofileloadexception-upon.html – Liedman

+0

Cảm ơn bạn !! Đã bỏ lỡ nút Bỏ chặn. – rickythefox