"MSBuild.ExtensionPack.UI.Console" task could not be loaded from

Dec 23, 2010 at 2:22 AM

Hi !

I want to use the console feature in extension for my msbuild proj file.

When i try to call the console it throw an error below

The "MSBuild.ExtensionPack.UI.Console" task could not be loaded from
 the assembly C:\Program Files\MSBuild\ExtensionPack\4.0\MSBuild.ExtensionPack.
dll. Could not load file or assembly 'file:///C:\Program Files\MSBuild\Extensio
nPack\4.0\MSBuild.ExtensionPack.dll' or one of its dependencies

I checked inside C:\Program Files\MSBuild\Extensio
nPack\4.0\ folder and MSBuild.ExtensionPack.dll exists there.

I'm not sure why msbuild throw that error.

<Project ToolsVersion="3.5" DefaultTargets="" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
      <TPath>$(MSBuildExtensionsPath)\ExtensionPack\4.0\MSBuild.ExtensionPack.tasks</TPath>
  </PropertyGroup>

  <Import Project="$(TPath)"/>
  <Target Name="Default">
    <!-- Read input from the user -->
    <MSBuild.ExtensionPack.UI.Console TaskAction="ReadLine">
      <Output TaskParameter="UserResponse" PropertyName="Line"/>
    </MSBuild.ExtensionPack.UI.Console>
    <Message Text="User Typed: $(Line)"/>
    <!-- Read input from the user and uppercase it all -->
    <MSBuild.ExtensionPack.UI.Console TaskAction="ReadLine" UserPrompt="Please enter your password and press the [Enter] key" ToUpper="true">
      <Output TaskParameter="UserResponse" PropertyName="Line"/>
    </MSBuild.ExtensionPack.UI.Console>
    <Message Text="User Typed: $(Line)"/>
    <!-- Play some beeps -->
    <MSBuild.ExtensionPack.UI.Console TaskAction="Beep" Repeat="3"/>
    <MSBuild.ExtensionPack.UI.Console TaskAction="Beep" Repeat="4" Duration="500" Frequency="1000"/>
    <MSBuild.ExtensionPack.UI.Console TaskAction="Beep" Repeat="3" Interval="2000"/>
  </Target>
 
  
</Project>

Coordinator
Dec 23, 2010 at 7:05 AM

Your sample works fine for me. Note you should use ToolsVersion="4.0" though.

Could you try repair your installation, just run the msi again and select Repair. Your folder should contain the following

    Help.ico , InstallerLogo.jpg , Interop.COMAdmin.DLL , Interop.IWshRuntimeLibrary.DLL , Ionic.Zip.DLL , IronPython.DLL , IronPython.Modules.dll , IronRuby.DLL , IronRuby.Libraries.dll , License.rtf , MSBuild Extension Pack Help.chm , MSBuild Extension Pack.url , MSBuild.ExtensionPack.BizTalk.dll , MSBuild.ExtensionPack.BizTalk.pdb , MSBuild.ExtensionPack.BizTalk.xsd , MSBuild.ExtensionPack.dll , MSBuild.ExtensionPack.dll.config , MSBuild.ExtensionPack.Framework.xsd , MSBuild.ExtensionPack.Iis7.dll , MSBuild.ExtensionPack.Iis7.pdb , MSBuild.ExtensionPack.Iis7.xsd , MSBuild.ExtensionPack.JSharp.dll , MSBuild.ExtensionPack.JSharp.pdb , MSBuild.ExtensionPack.JSharp.xsd , MSBuild.ExtensionPack.Loggers.dll , MSBuild.ExtensionPack.Loggers.pdb , MSBuild.ExtensionPack.MSTFSBuild2008.xsd , MSBuild.ExtensionPack.pdb , MSBuild.ExtensionPack.Sql2005.dll , MSBuild.ExtensionPack.Sql2005.pdb , MSBuild.ExtensionPack.Sql2005.xsd , MSBuild.ExtensionPack.Sql2008.dll , MSBuild.ExtensionPack.Sql2008.pdb , MSBuild.ExtensionPack.Sql2008.xsd , MSBuild.ExtensionPack.StyleCop.dll , MSBuild.ExtensionPack.StyleCop.pdb , MSBuild.ExtensionPack.StyleCop.xsd , MSBuild.ExtensionPack.Sync.dll , MSBuild.ExtensionPack.Sync.pdb , MSBuild.ExtensionPack.Sync.xsd , MSBuild.ExtensionPack.TaskFactory.Dlr.dll , MSBuild.ExtensionPack.TaskFactory.Dlr.pdb , MSBuild.ExtensionPack.TaskFactory.PowerShell.dll , MSBuild.ExtensionPack.TaskFactory.PowerShell.pdb , MSBuild.ExtensionPack.tasks , MSBuild.ExtensionPack.Tfs.dll , MSBuild.ExtensionPack.Tfs.pdb , MSBuild.ExtensionPack.Tfs.xsd , MSBuild.ExtensionPack.VersionNumber.targets , MSBuild.ExtensionPack.Virtualisation.VirtualPc.x , MSBuild.ExtensionPack.WindowsVirtualPC.dll , MSBuild.ExtensionPack.WindowsVirtualPC.pdb , Samples , Web.ico 

can you also run with /v:diag so we see the assembly its really trying to resolve to, e.g.

Target "Default: (TargetId:2)" in project "d:\a\cons.proj" (entry point):Using "MSBuild.ExtensionPack.UI.Console" task from assembly "C:\Program Files (x86)\MSBuild\ExtensionPack\4.0\MSBuild.ExtensionPack.dll".Task "MSBuild.ExtensionPack.UI.Console" (TaskId:2)  Please enter a response and press [Enter]: (TaskId:2)

And one other gotcha, please ensure you have no old version in the GAC.

Mike

 

 

Dec 24, 2010 at 6:35 AM

Hi Mike!

You're right.

I think i have an old version of .net framework and it's compatible with extension pack 4.0.

I dowload extension pack 3.5 and it workss now.

Thanks for your help.