Catel 4.0.0 and Dependency on Microsoft.Bcl.Build - c#-4.0

When updating a project to use current Catel version (4.0) I am getting this warning:
All projects referencing MyInfrastructureProject.csproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569.
The error is reported for projects that references MyInfrastructureProject.csproj.
I find it odd that I need to add additional libraries to other project especially when it is concerned with nuget (if I am getting the picture correctly) and not with actual functionality of my code (or maybe even Catel). But in any case, I don't really understand the issue.
I searched a little for this issue but didn't find relevant details or explanations.
Should I go ahead and add the Microsoft.Bcl.Build reference everywhere in my project?
Thanks,
Tomer

If you don't know what is Microsoft.Bcl.Async you should study it.
Catel uses this feature pack so as to use async/await on .NET 4 and Silverlight 5. So if you use Catel in a .NET 4 project, you inherit the same dependencies, which is what the warning says.
Thus, yes, please go ahead and add the NuGet package to the necessary projects, or simply upgrade your projects to .NET 4.5 and reapply the NuGet packages.

Related

Cannot add Microsoft.Azure.Devices to ASP.NET 5 project: can't find fx/System.Net.Http.Formatting

When adding the Microsoft.Azure.Devices NuGet package (I've tried 1.0.0, 1.0.2, and 1.0.4) to an ASP.NET 5 (Web API 2) project, the reference to System.Net.Http.Formatting is marked as not resolvable with
NU1001 The dependency fx/System.Net.Http.Formatting could not be resolved
There are several NU1001 issues out there, but none whose causes seem to map to this one. The best reference is this one on Github, but the resolution details were sketchy.
The reference DLL is indeed marked as Copy Local when the package is brought into a 'legacy' assembly package, so I can see why it might not find it, but can't determine the right way to fix it.
In my actual use-case, Microsoft.Azure.Devices is being referenced by a .NET assembly package and THAT is then included as a project reference in the ASP.NET 5 project, and indeed that gives the same error as trying to directly reference the NuGet from the ASP.NET 5 project.
We're using dnx452 as the only framework referenced in the project.json file.
I tried this with version 1.0.5 and it installed successfully for me.

MSBuild now failing to resolve references

We have a few projects within our CI environment which have been building successfully. Over the weekend, our IT team installed Azure SDK udpates, and since then, our project to not build anymore (even though they don't reference Azure).
The way we are building projects is
<MSBuild Condition="'$(BuildProject)' != ''" Projects="#(Projects)"
Properties="Platform=$(Platform);Configuration=$(Configuration);OutDir=$(TempProjectFilesPublish)\bin\;WebProjectOutputDir=$(TempProjectFilesPublish)"
Targets="Build"
ContinueOnError="false">
where #(Projects) is a reference to the Solution folder.
<Projects Include="$(BuildProject)"/>
The issue is around resolving project references. Nothing has changed over the weekend. The project references are correct, the csproj file has the appropriate values, no new projects or code changes have been made which is leading me to think something has been disrupted.
Wondering if anyone might know of any changes to MSBuild that would affect this?
This issue ended up being a bug in Azure SDK 2.3 with a conflict to Newtonsoft.JSON dll.
The SDK installs a 4.5 build version into the GAC, which is overriding any Newtonsoft references in projects to 4.0.
https://connect.microsoft.com/VisualStudio/feedback/details/850425/windows-azure-vs-tools-breaking-msbuild-for-web-projects
Microsoft have stated this will be fixed in 2.4.
I experience the same problem with Azure SDK v2.9. I've fixed the build for the moment by uninstalling "Microsoft Azure Library for .NET v2.9".
P.S.: Unfortunately, the link provided in the answer by mickyjtwin no longer works.
P.P.S.: The following question seems to be related:
Visual Studio keeps overwriting NewtonSoft.Json.DLL with an older version

Using specific version of packages in MonoDevelop

What is the best way to handle specific version of libraries while using MonoDevelop (precisely - use ServiceStack v3 instead of ServiceStack v4)?
Unfortunately, MonoDevelop's addin NuGet does not allow specifying package version (no Package management console support). I've tried hacking it in .csproj and package.config file but it does not work entirely well and it seems to be smelly solution.
One obvious solution is to get rid of NuGet and reference libraries locally after manually downloading them.
How would you solve this problem?
Thanks for all responses :)
Being able to add a specific version of a NuGet package with the MonoDevelop addin is on the todo list.
If you have access to Windows you could use SharpDevelop to add a specific version using its Package Management console.
Or as you have suggested, edit the packages.config file, then restore the packages. However you will need to add the required assembly references by hand. This option is not that bad if there are not that many assembly references and you are not going to be updating the NuGet package very often. Although the benefit of this approach over downloading the NuGet package, extracting it, and directly referencing the assemblies is equivalent and the same amount of work. Also doing it this way you can more easily update the references by simply dropping the new binaries into your lib folder.
Or you could change the source code of the addin. I thought about adding a simple text box where you could specify a particular version. Ideally the dialog would give you a list of available versions.
I would probably just download the ServiceStack assemblies you need and directly reference them.

updating a component using NuGet, when one project in the solution is already updated to the latest one

I have a general framework project which is referenced by many solutions. Whenever there is an update to a component which I would like to upgrade to, I normally right-click on the solution > Manage NuGet packages for solution > upgrade component for all projects. The problem is that for all other solutions, their projects (except from the common referenced one) is not updated to the latest one. If I try to do the same, it will not let me click on 'Update' to update all projects, as it detects that one project is already using the latest version. I have some other 4 or 5 projects in most solutions, and it is quite a headache to update them manually. Any ideas about it? I am using the latest version of NuGet and VS2012.
Right-click the outdated project in the solution and select Manage NuGet Packages from the context menu. Your Manage NuGet Packages window will now only affect the scope of that one project you selected and you should be able to perform an update to the project directly. Repeat for all your other packages.

Trouble adding PCL NuGet package to PCL project with custom profile

So I've been working on a game, and the sheer number of projects has become unmanageable. Enter NuGet.
I wanted to ensure my code would work on different devices, so I've been making these projects as Portable Class Libraries. I needed to use these on XBox, Windows, iOS, Android, and Silverlight. I created some custom custom SupportedFrameworks in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.0\Profile\Profile1\SupportedFrameworks
Specifically MonoAndroid and VSMonoTouch
I successfully turned one of these PCLs into a NuGet package, but when I try to add them to another PCL of the same profile I get this error:
Could not install package 'Framework.dll 1.0.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.0,Profile=Profile1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
The package folder was brought down and contains a folder named: portable-win+net40+MonoAndroid16+sl40+net10+wp+Xbox40 and indeed contains the requested dll. I am able to add this dll to my project manually, so I believe this may be a bug in NuGet. I investigated this online, and found the main fix was to update NuGet, because the newest version plays nicer with PCLs. I've updated, but to no avail.
Has anyone seen this before, or am I missing something obvious? Any help would be greatly appriated =)
Thanks,
Joshua
It looks like you are using ".NETFramework" for the identifier in the XML file you put in the Profile1 SupportedFrameworks folder. This was basically a hack to get iOS projects building on Windows, but with real support for that scenario you should change that identifier to MonoTouch. Then when you create the package it should use monotouch in place of net10 for the lib/portable-x+y+z folder.
Then, as #Deepak suggests, install the nightly build of NuGet. Then you should be able to install the NuGet package into your PCL project. If you do try this, please let me know whether it worked or not. :)

Resources