Home Dashboard Directory Help
Search

Microsoft.Bcl.Build.targets causes project loading to fail by abatishchev


Status: 

Active


80
0
Sign in
to vote
Type: Bug
ID: 788981
Opened: 5/30/2013 11:19:59 AM
Access Restriction: Public
6
Workaround(s)
view
26
User(s) can reproduce this bug

Description


Enabling nuget packages auto-restore and updating Microsoft.Net.Http to ver. 2.1.10 introducing a dependency on Microsoft.Bcl.Build adds a new import into the project.
Now it can't be loaded on other dev machines due missing of this package/folder/targets file.
File can't be downloaded/package can't be restored because the only project referencing it is not loaded.
Details
Sign in to post a comment.
Posted by George Lanes on 8/20/2013 at 7:51 PM
Try install BCL from package manager console.

PM> Install-Package Microsoft.Bcl.Build -Version 1.0.X

After to install, restore the missing references.

Best Regards

George
Posted by Microsoft on 7/23/2013 at 8:50 AM
Hi Stef,

Sounds like the version of NuGet you've checked is outdated. You should be able to upgrade it by running nuget.exe update -self.

Thanks,
-Immo
Posted by Stef Heyenrath on 7/22/2013 at 12:52 PM
Hi Jonathan, this fix does unfortunately not work for appharbor deployed web applications. I get this error during deploy:


Build FAILED.

     "D:\temp\4phgtvgc.tsb\input\KendoGridBinderExSolution.sln" (default target) (1) ->
     "D:\temp\4phgtvgc.tsb\input\KendoGridBinderEx.Examples.MVC\KendoGridBinderEx.Examples.MVC.csproj" (default target) (5) ->
     (RestorePackages target) ->
         D:\temp\4phgtvgc.tsb\input\.nuget\nuget.targets(43,9): error : The schema version of 'Microsoft.Bcl' is incompatible with version 1.6.21205.9031 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942. [D:\temp\4phgtvgc.tsb\input\KendoGridBinderEx.Examples.MVC\KendoGridBinderEx.Examples.MVC.csproj]
         D:\temp\4phgtvgc.tsb\input\.nuget\nuget.targets(43,9): error MSB3073: The command ""D:\temp\4phgtvgc.tsb\input\.nuget\nuget.exe" install "D:\temp\4phgtvgc.tsb\input\KendoGridBinderEx.Examples.MVC\packages.config" -source "" -o "D:\temp\4phgtvgc.tsb\input\packages"" exited with code 1. [D:\temp\4phgtvgc.tsb\input\KendoGridBinderEx.Examples.MVC\KendoGridBinderEx.Examples.MVC.csproj]

Any ideas how to solve this ?
Posted by Jonathan Gill UK on 7/3/2013 at 5:48 AM
Hi Stef

If your using git with appharbor my gist should work for you https://gist.github.com/Bigjono/5917578
Posted by Stef Heyenrath on 6/18/2013 at 3:04 AM
The automatic build and deployment on AppHB (appharbor.com) is also broken due to this bug.

I was not able to solve the error on AppHB with the work-arounds posted here, did anyone have more luck on that topic ?
Posted by Microsoft on 6/13/2013 at 2:58 PM
Thanks for reporting this issue.

We've published a blog post that describes what you can do to workaround the problem and how we are intending to fix it in the long run. Unfortunately, at this point there isn't a good solution or fix we could provide you with.

http://blogs.msdn.com/b/dotnet/archive/2013/06/12/nuget-package-restore-issues.aspx

Thanks,
Immo Landwerth
Program Manager
.NET Framework Team
Posted by Chris McKee UK on 6/13/2013 at 8:24 AM
One day MSFT will test things before pushing them out; more so when its via NUGET
Posted by Carsten Schütte on 6/3/2013 at 11:31 AM
I can confirm this (ugly) problem.
Posted by Microsoft on 5/31/2013 at 12:46 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 5/30/2013 at 11:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Posted by abatishchev on 5/30/2013 at 11:47 AM
A piece of TeamCity log proofing the issue:

Compilation errors

C:\TeamCity\buildAgent\work\7c87751726a5d2e3\ProductOnboarding\ProductOnboarding.csproj(229, 3): error MSB4019: The imported project "C:\TeamCity\buildAgent\work\7c87751726a5d2e3\packages\Microsoft.Bcl.Build.1.0.5\tools\Microsoft.Bcl.Build.targets" was not found.
Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. Project ProductOnboarding\ProductOnboarding.csproj failed.
C:\TeamCity\buildAgent\work\7c87751726a5d2e3\ProductOnboarding.Tests\ProductOnboarding.Tests.csproj(81, 3): error MSB4019: The imported project "C:\TeamCity\buildAgent\work\7c87751726a5d2e3\packages\Microsoft.Bcl.Build.1.0.5\tools\Microsoft.Bcl.Build.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Project ProductOnboarding.Tests\ProductOnboarding.Tests.csproj failed. Project StoreXpCatalog.sln failed.
Sign in to post a workaround.
Posted by Unsettling on 2/19/2014 at 7:11 AM
Avoid the problems with the Microsoft BCL Portability Pack, which I had in an ASP.NET MVC 4 project, and just get rid of it.

Remove all System.Net.Http and System.Net.Http.* references then use NuGet to remove the BCL Portability Pack. Use NuGet to install an earlier version of System.Net.Http that doesn’t rely on BCL:Install-Package Microsoft.Net.Http -Version 2.0.20710.0

Then update the web.config:
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
Posted by Jonathan Gill UK on 7/3/2013 at 5:45 AM
If you are using git as your source control I have created a gist that should get this working for you

https://gist.github.com/Bigjono/5917578
Posted by Andriy F on 6/14/2013 at 2:33 PM
1. Add dummy project (NugetHelper for example), add package.config with

    <package id="Microsoft.Bcl.Build" version="1.0.6" targetFramework="net45" />

2. Open Menu -> Project -> ProjectDependencies and make NugetHelper to build before other projects in solution

3. Replace

<Import Project="..\packages\Microsoft.Bcl.Build.1.0.6\tools\Microsoft.Bcl.Build.targets" />

with

<Import Project="..\packages\Microsoft.Bcl.Build.1.0.6\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.6\tools\Microsoft.Bcl.Build.targets')" />

this will restore Microsoft.Bcl.Build.targets before actually loading it in main project
Posted by Microsoft on 6/14/2013 at 9:20 AM
@Marc: Unfortunately your workaround doesn't work. Please see our blog post for details.

http://blogs.msdn.com/b/dotnet/archive/2013/06/12/nuget-package-restore-issues.aspx
Posted by Microsoft on 6/14/2013 at 9:18 AM
Please checkin any .target files that are in the packages directory,
i.e. "packages\Microsoft.Bcl.Build.1.0.7\tools\Microsoft.Bcl.Build.targets"
Posted by Marc C Brooks on 6/7/2013 at 2:05 PM
In your project file, replace the line that imports the Microsoft.Bcl.Build.targets file with this one... make sure to match the number of .. in your current line (as the packages directory can be in different relative placement for any particular solution)

<Import Project="..\packages\Microsoft.Bcl.Build.1.0.7\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.7\tools\Microsoft.Bcl.Build.targets')" />

(assumes you have 1.0.7 installed, but works with 1.0.6 as well.