Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get a NotSupportedException when running MSpec on TeamCity?

Tags:

teamcity

mspec

When running an MSpec build step in TeamCity I am getting the following error in the team city logs:

[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

I have made the suggested modification to the machine.config and the MSpec config file, but it does not seem to help.

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

The MSpec runner is referencing a compiled DLL locally on the build agent that runs correctly locally in Visual Studio. Can anyone explain what this error means and how I might go about resolving it?

like image 464
78lro Avatar asked Oct 02 '12 16:10

78lro


People also ask

What is system platform notsupportedexception?

System. Platform Not Supported Exception NotSupportedException indicates that no implementation exists for an invoked method or property. NotSupportedException uses the HRESULT COR_E_NOTSUPPORTED, which has the value 0x80131515.

What is the value of notsupportedexception?

NotSupportedException indicates that no implementation exists for an invoked method or property. NotSupportedException uses the HRESULT COR_E_NOTSUPPORTED, which has the value 0x80131515. For a list of initial property values for an instance of NotSupportedException, see the NotSupportedException constructors.

What is platform not supported exception in Java?

Platform Not Supported Exception NotSupportedException indicates that no implementation exists for an invoked method or property. NotSupportedException uses the HRESULT COR_E_NOTSUPPORTED, which has the value 0x80131515. For a list of initial property values for an instance of NotSupportedException, see the NotSupportedException constructors.


1 Answers

Can you check the properties of mspec.exe or the "compiled DLL" to see if there's a security Unblock button. I had the same error and Unblock fixed it. Enabling loadFromRemoteSources didn't help.

like image 193
pellucid Avatar answered Sep 30 '22 13:09

pellucid