2
Vote

SheepAspect won't do postcompile weaving in TeamCity build

description

When we are building locally SheepAspect works like a charm, but when we build via TeamCity we get the following error:

D:\TCData\Work\e78aa496ea756bf6\packages\SheepAspect.0.2.0.1\tools\SheepAspect.targets(4, 5): System.NullReferenceException: Object reference not set to an instance of an object.
at SheepAspect.Tasks.PostCompileWeaveTask.Execute()

comments

SeriousM wrote Apr 2, 2012 at 2:21 PM

i have the same error with v.0.3.0.3 on teamcity and ncrunch.

hendryluk wrote Nov 26, 2012 at 1:14 AM

First of all, apologies for a massively delayed response. I did not realise I don't get an email notification from the issue tracker.
I have seen the NRE you're reporting during post-compilation process on certain Visual Studio environments, and have since been fixed (on v0.3.0.5). This most likely will also fix your issue on TeamCity.
Once again thanks for reporting the issue. Please update to the latest version via NuGet and do let me know whether it solves your problems.

hendryluk wrote Nov 26, 2012 at 1:48 AM

Yes that bug is still present in 0.3.0.3. The fix was applied on 0.3.0.5.

swingsetacid wrote Apr 10 at 10:46 PM

We're getting a similar issue when running in TeamCity. Builds work fine locally, but don't on the build agent. Below are the exception and fusion loader logs. It looks like the loader is attempting to load SheepAspect from the Tools directory, not the Lib directory. Anyone else experiencing the same issue?

Thanks!

System.IO.FileNotFoundException: Could not load file or assembly 'SheepAspect, Version=0.3.0.11, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'SheepAspect, Version=0.3.0.11, Culture=neutral, PublicKeyToken=null'
at SheepAspect.Tasks.AppDomainIsolatedDiscoveryRunner.Process(String configFile, TaskLoggingHelper logger, String[]& weavedFiles)
at SheepAspect.Tasks.PostCompileWeaveTask.Execute()

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = SheepAspect, Version=0.3.0.11, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/
LOG: Initial PrivatePath = NULL

Calling assembly : SheepAspect.Tasks, Version=0.3.0.11, Culture=neutral, PublicKeyToken=null.

LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/SheepAspect.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/SheepAspect/SheepAspect.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/SheepAspect.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/SheepAspect/SheepAspect.EXE.
LOG: Attempting download of new URL file:///C:/TeamCity/buildAgent/work/f957c9968fa39b59/WTL/packages/SheepAspect.0.3.0.11/Tools/SheepAspect.DLL.
LOG: Attempting download of new URL file:///C:/TeamCity/buildAgent/work/f957c9968fa39b59/WTL/packages/SheepAspect.0.3.0.11/Tools/SheepAspect/SheepAspect.DLL.
LOG: Attempting download of new URL file:///C:/TeamCity/buildAgent/work/f957c9968fa39b59/WTL/packages/SheepAspect.0.3.0.11/Tools/SheepAspect.EXE.
LOG: Attempting download of new URL file:///C:/TeamCity/buildAgent/work/f957c9968fa39b59/WTL/packages/SheepAspect.0.3.0.11/Tools/SheepAspect/SheepAspect.EXE.

hendryluk wrote Apr 11 at 8:04 AM

Hi,
I can't seem to replicate the same error in TeamCity.
What build method do you use in TC?
I use sln build against this public repository: https://github.com/hendryluk/SheepAspectPlay, and it seems to build successfully on TC.
Is there anything specific with your TeamCity build configuration?
Otherwise maybe you can try using your TC configuration against https://github.com/hendryluk/SheepAspectPlay to test?
Please let me know how it goes.