Build/Test Issues

Build Project w/ Console Tool

Started by seancapstick on 5,744 views

I am attempting to get NCrunch integrated w/ TeamCity on a build-server for some automated test runs. So far I've:
- installed the console tool on my build-server machine
- applied lisence information
- copied over my project to the build-server
- have installed (I think) Visual Studio SDKs/toolsets necessary to build the project
- created a console tool config XML file (copied from the one created automatically w/ slight changes)

I am trying a trial run to see if the project will build at all and am encountering an error upon execution:

[img=http://imgur.com/vzFhngS]NotSupportedException[/img]

Do I need to install the NuGet packages for my projects separately or will the console tool find/build them?

Any help appreciated, thanks.
Hi, thanks for sharing this issue.

This looks to be either an installation issue or .NET configuration issue with the machine you're running the console tool on. Check the following:

https://stackoverflow.com/questions/18016315/an-attempt-was-made-to-load-an-assembly-from-a-network-location-which-would-have

Everything else you've described is the correct setup approach for the console tool. It should work, we just need to find out why .NET is blocking the tool from loading its own assemblies.
Thanks - I managed to get past that and get a 'Returning result: OK' but I am getting some exceptions for each of my 'Modules" under 'Console Tool' folder. An example is:
---
[12:17:13.9366-Core-6] Loading module: E:\NCrunch\Console Tool\Modules\Gallio\nC
runch.Module.Gallio.crunchmodule
[12:17:13.9482-Core-6] ERROR (Internal): An exception thrown while processing th
e module 'E:\NCrunch\Console Tool\Modules\Gallio\nCrunch.Module.Gallio.crunchmod
ule': System.IO.FileLoadException: Could not load file or assembly 'file:///E:\N
Crunch\Console Tool\Modules\Gallio\nCrunch.Module.Gallio.dll' or one of its depe
ndencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///E:\NCrunch\Console Tool\Modules\Gallio\nCrunch.Module.Gallio
.dll' ---> 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 doe
s 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.

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String cod
eBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&
stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntro
spection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName as
semblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMar
k& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIn
trospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Ev
idence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm,
Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackM
ark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at nCrunch.Core.ModuleManagement.ModuleLoader.LoadModules(IList`1 additionalS
earchPaths)
---

I get this for each of the 'E:\NCrunch\Console Tool\Modules\[module]\nCrunch.Module.[module].crunchmodule' files. I've restored the NuGet packages required to build the project. Any idea?

Edited

This looks to be exactly the same problem, but for a different assembly. The O/S is now preventing NCrunch from loading the assemblies of its modules.

If you've extracted the tool from ZIP, make sure all binaries in the install path are unblocked by Windows.
You're right - though I did try unblocking them but I forgot to mention that which is why I posted. But I went ahead and scrapped the Console Tool dir and unblocked the whole ZIP before extracting again and that seemed to do the trick. It is building and executing tests now.

Edited

Post a reply

Log in to reply.