SaguiItay
SaguiItay

Reputation: 2215

Team build and Dotfuscator

I've created a solution that includes all my projects, including the Dotfuscator projects, and setup projects. Some of the Dotfuscator projects are obfuscating only some assemblies, without affecting any of their references. When building from Visual Studio, this works great. However, when I run a team build, I get the following error:

C:\Program Files\MSBuild\PreEmptive\Dotfuscator\4.0\PreEmptive.Dotfuscator.Targets(20,3): error : Couldn't load external type because its assembly can't be found:

The external assembly is references by the assembly being obfuscated, however it is not part of the obfuscation project.

Upvotes: 4

Views: 4606

Answers (2)

Steve Johnson
Steve Johnson

Reputation: 3114

C:\Program Files\MSBuild\PreEmptive\Dotfuscator\4.0\PreEmptive.Dotfuscator.Targets

This assembly must lie on the same server as your Build agent Machine.

In simple words, assuming the TFSServer is your Data Tier MAchine Name (Containing Source files) as well as Build Machine then dotfuscator target files need to accessible to it.

Simply install dotfuscator on the **TFSServer Machine and the path will become accessible to it alongwith the associated target files.**

Upvotes: 0

Joe Kuemerle
Joe Kuemerle

Reputation: 6364

The referenced assembly does not have to be part of the Dotfuscator project but it does need to be available for Dotfuscator to read. I suspect that the referenced assembly is either in the same directory as your input assemblies on your workstation, in the path of your workstation or in the GAC. It is probable that the referenced assembly is not on your build server (or is not locatable by Dotfuscator). You can provide User Defined Assembly Load Paths where Dotfuscator will additionally look when attempting to resolve referenced assemblies.

The referenced assembly will be required on the build server for Dotfuscator to successfully obfuscate and the best way is to either ensure the referenced assembly is in the same directory as the input assemblies or to use a User Defined Assembly Load Path.

Also, new in version 4.5.1200 you can have your User Defined Assembly Load Path's searched first rather than the default of searching them last.

Upvotes: 3

Related Questions