Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Build Project w/ Console Tool
seancapstick
#1 Posted : Friday, September 2, 2016 4:23:07 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/2/2016(UTC)
Posts: 3
Location: Canada

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
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.
Remco
#2 Posted : Friday, September 2, 2016 10:40:44 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
1 user thanked Remco for this useful post.
seancapstick on 9/6/2016(UTC)
seancapstick
#3 Posted : Tuesday, September 6, 2016 4:21:22 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/2/2016(UTC)
Posts: 3
Location: Canada

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
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?
Remco
#4 Posted : Tuesday, September 6, 2016 11:25:49 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
seancapstick
#5 Posted : Wednesday, September 7, 2016 11:56:43 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/2/2016(UTC)
Posts: 3
Location: Canada

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
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.
1 user thanked seancapstick for this useful post.
Remco on 9/7/2016(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.039 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download