cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ericbuild
Level 2

Standadlone build error with MSBUILD

I am using the standalone 2011 build agent with MSBUILD and am encountering the following error, reported when trying to build the isproj. It is coming from the install shield targets xml.

C:\Program Files (x86)\MSBuild\InstallShield\2011\InstallShield.targets(11,3): error MSB4062: The "Microsoft.Build.Tasks.AssignProjectConfiguration" task could not be loaded from the assembly Microsoft.Build.Tasks.v3.5. Could not load file or assembly 'Microsoft.Build.Tasks.v3.5' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

The Microsoft dll is in the GAC. Any ideas on how to get past this?

This is using MSBUILD v4. Do I have to use v3.5?
Labels (1)
0 Kudos
(12) Replies
Jool2k11
Level 3

was working fine with build agent 2008

now we migrated on tfs 2010 and installed tfs build service 2010 on msbuild machine

i have the same error
0 Kudos
Jool2k11
Level 3

is to copy the Microsoft.Build.Tasks.v3.5.dll from
%WINDOWS%\Microsoft.NET\Framework\v3.5

to
%Program Files%\MSBuild\InstallShield\2011

it worked for me

i will try to find the reason later.

i think there's a problem with the Fusion Policy rules.
0 Kudos
dwardlaw
Level 2

I was wondering if this issue had been resolved. I have the same one with 2012SpringLimited Edition?

Calling:
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MySolution.sln /p:Configuration=Release.

C:\Program Files (x86)\MSBuild\InstallShield\2012SpringLimited\InstallShield.targets(21,3): error MSB4062: The "Microsoft.Build.Tasks.AssignProjectConfiguration" task could not be loaded from the assembly Microsoft.Build.Tasks.v3.5. Could not load file or assembly 'Microsoft.Build.Tasks.v3.5' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.


I have tried setting all configs to target x86 and still no luck. This happens on our build server and my dev box.
0 Kudos
tomas_ivan
Level 3

Hi ! We are using IS 2012 LE & TFS 2012.
When using Visual studio 2012 on the build server, the build is successful, but when running Build Definition on TFS we got this :

C:\Program Files (x86)\MSBuild\InstallShield\2012SpringLimited\InstallShield.targets (21): The "Microsoft.Build.Tasks.AssignProjectConfiguration" task could not be loaded from the assembly Microsoft.Build.Tasks.v3.5. Could not load file or assembly 'Microsoft.Build.Tasks.v3.5' or one of its dependencies. The system cannot find the file specified. Confirm that the  declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.


Copying the file from %WINDOWS%\Microsoft.NET\Framework\v3.5 to %Program Files%\MSBuild\InstallShield\2012SpringLimited does not help.
0 Kudos
tomas_ivan
Level 3

Finally found out solution :
change file InstallShield.targets
so it reads 'AssemblyFile="Microsoft.Build.Tasks.v3.5.dll" '
instead of 'AssemblyName="Microsoft.Build.Tasks.v3.5.dll" '
and copy that dll to the same folder where is InstallShield.targets.

However I don't know why it cannot use this dll from GAC.
0 Kudos
pavel_agejkin
Level 2

Thank you, tomas.ivan
your replay helped me to fix same problem.

p.s. using Windows 8 with VS2012 and 2012SpringLimited
0 Kudos
jhilton1
Level 2

That solution isn't working for me for some reason.

I get the following error :

error MSB4062: The "Microsoft.Build.Tasks.AssignProjectConfiguration" task could not be loaded from the assembly C:\Program Files\MSBuild\InstallShield\2012SpringLimited\Microsoft.Build.Tasks.v3.5. Could not load file or assembly 'file:///C:\Program Files\MSBuild\InstallShield\2012SpringLimited\Microsoft.Build.Tasks.v3.5' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

I've copied both the 3.5 and 4.0 build task dll's to the C:\Program Files\MSBuild\InstallShield\2012SpringLimited\ directory, and changed the UsageTasks to AssemblyFile, but for some reason msbuild still isn't working. Any ideas at this point would be greatly appreciated.

Thanks!
0 Kudos
randy1234
Level 2

Updating InstallShield.targets using the assembly full name worked for me.


AssemblyName="Microsoft.Build.Tasks.v3.5,Version=3.5.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
Condition="'$(MsBuildToolsVersion)'=='3.5'"/>
0 Kudos
jhilton1
Level 2

That worked!

Thank you!
0 Kudos
jacobsmaki
Level 2

randy1234 wrote:
Updating InstallShield.targets using the assembly full name worked for me.


AssemblyName="Microsoft.Build.Tasks.v3.5,Version=3.5.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
Condition="'$(MsBuildToolsVersion)'=='3.5'"/>


I tried updating the InstallShield.targets and after I do so, it says "The product license has expired or has not yet been initialized". Did you run in to this issue? If so, how'd you get around it? Thankfully, I backed up the file prior and just renamed it back and the license error went away...

I've also tried copying the build tasks DLL as mentioned without any luck.
0 Kudos
the_vinculum
Level 3

When changing assemblyname to assemblyfile it is mandatory to add .dll suffix to it as msbuild would be looking for the dll without the .dll extension eg Microsoft.Build.Tasks.v3.5 instead of Microsoft.Build.Tasks.v3.5.dll and not find it.

However fixing this introduced a follow up issue with ISWIBuild: -2147221164
0 Kudos
csnate
Level 2

You shouldn't need to update the InstalShield.targets file at all or copy the .NET assemblies anywhere. Just add /toolsversion:4.0 to your command:


msbuild.exe MySolution.sln /t:Clean;Build /property:Configuration=Release /toolsversion:4.0
0 Kudos