SA MSbuild task errors out during Teambuild

.NET obfuscator and automated error reporting

SA MSbuild task errors out during Teambuild

Postby Sjohn » Mon Aug 05, 2013 12:24 pm

Hello, I'm using SmartAssembly 6.8.
My workflow involves a solution that builds 6 other .dll files before building an .exe file project at the end.
It is that .exe file which is obfuscated, has the .dll files obfuscated + merged, or embedded.
When running a local build from VS2010, (either via Build->Build Solution or Right clicking on the .exe project and publishing using ClickOnce,) I am able to create and obfuscate my the .exe successfully during the \"AfterCompile\" target containing the SmartAssembly.MSBuild.Tasks.Build command.

However, when attempting to build the project via Teambuild, I receive the following error:
Code: Select all
...Unhandled Exception: Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: Attempted to use an inactive task host.
 at Microsoft.Build.Shared.ErrorUtilities.VerifyThrow(Boolean condition, String unformattedMessage)
 at Microsoft.Build.BackEnd.TaskHost.LogMessageEvent(BuildMessageEventArgs e)
 at Microsoft.Build.Utilities.TaskLoggingHelper.LogMessage(MessageImportance importance, String message, Object[] messageArgs)
 at System.IO.TextWriter.SyncTextWriter.WriteLine(String value)
 at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)
 at Microsoft.Build.CommandLine.MSBuildApp.Main()
 TF270015: 'MSBuild.exe' returned an unexpected exit code. Expected '0'; actual '255'.

Digging further into the log, this is what it says:
Code: Select all
  Copying file from \"Config\\Test\\app.config\" to \"C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Binaries\\Test\\TimeBloxGUI.exe.config\".
  Copying file from \"obj\\Test\\TimeBloxGUI.exe.manifest\" to \"C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Binaries\\Test\\TimeBloxGUI.exe.manifest\".
  TimeBloxGUI -> C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Binaries\\Test\\TimeBloxGUI.exe.manifest
  Copying file from \"obj\\Test\\TimeBloxGUI.application\" to \"C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Binaries\\Test\\TimeBloxGUI.application\".
  TimeBloxGUI -> C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Binaries\\Test\\TimeBloxGUI.application
  Copying file from \"obj\\Test\\TimeBloxGUI.exe\" to \"C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Binaries\\Test\\TimeBloxGUI.exe\".
  TimeBloxGUI -> C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Binaries\\Test\\TimeBloxGUI.exe
  Copying file from \"obj\\Test\\TimeBloxGUI.pdb\" to \"C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Binaries\\Test\\TimeBloxGUI.pdb\".
  SmartAssembly v6.8.0.121
  Copyright © Red Gate Software 2005–2013
C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj(521,5): error : SmartAssembly build failed:
C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj(521,5): error : The type initializer for '.' threw an exception.
C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj : warning : The type initializer for '.' threw an exception.
C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj : warning :    at Œ.€.()
C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj : warning :    at ...ctor(String ,  )
C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj : warning :    at ...ctor(String , Boolean ,  )
C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj : warning :    at Œ.€.( , Boolean , String )
C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj : warning :    at Œ.€.(String )
C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj : warning :    at SmartAssembly.ConsoleApp.CommandLineAction(String ,  , Dictionary`2 )
C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj : warning :    at SmartAssembly.ConsoleApp.Run(String[] , Boolean )
C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj : warning :    at SmartAssembly.ConsoleApp.Run(String[] )
Done Building Project \"C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI\\TimeBloxGUI.csproj\" (default targets) -- FAILED.
Done Building Project \"C:\\MSVS\\CTMS\\Obfuscated TimeBloxGUI\\Sources\\TimeBloxGUI.sln\" (default targets) -- FAILED.


I don't know why this occurs.
Additionally, I can get it to \"build\" and obfuscate successfully from a team build using the \"AfterBuild\" target and the exec command=, however this causes issues with our post-build scripts...effectively breaking our workflow.
My .saproj file is looking for the dependency paths using the following structure:
Code: Select all

with Test being that configuration (there are 3, and each has its own .saproj and files for that version). So I know that everything should be in the proper place & visible...

Does anyone know why the SA MSbuild task would be able to obfuscate successfully during a localbuild/ClickOnce Publish (locally), but generate the described errors during a Team Build?
Posts: 1
Joined: Mon Aug 05, 2013 11:42 am

Postby jessica.ramos » Wed Aug 07, 2013 12:19 am

Thanks for your post! I'm afraid I'm not immediately sure what could be wrong. It's possible this is another issue with having multiple log4net versions in the VS environment (as the issue here: ... hp?t=15925 )

But if this is not the case, could you please try a team build with all SmartAssembly options turned off for your assembly and see if the failed build persists?
Jessica Ramos
Technical Support
Red Gate Software Ltd.
Posts: 503
Joined: Mon Apr 23, 2012 12:13 pm

Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 0 guests