简体   繁体   中英

NuGet for Microsoft.Azure packages

I am trying to write an application that uses Microsoft Azure. I am using VS2012 and have installed update 5. I also updated NuGet to the latest version.

In my code, I am using the following:

    using Microsoft.Azure.Management.Compute;
    using Microsoft.Azure.Management.Compute.Models;
    using Microsoft.Azure.Management.Fluent;
    using Microsoft.Azure.Management.Resource.Fluent.Authentication;
    using Microsoft.Azure.Management.Resource.Fluent.Core;

When I go to package manager, 'Microsoft.Azure.Management.Compute' installs successfully, but the Fluent and Resource packages won't - it says that it's unable to find the packages.

Does anyone have any thoughts on what I'm missing?

Good day,

You need to install the Microsoft.Azure.Management.Fluent package as well. In Package Manager Console, target your project and run:

Install-Package Microsoft.Azure.Management.Fluent -Pre

This is a pre-release package so it will not show up unless you include the -Pre option or select the Include prerelease option within the NuGet window (if you are adding packages this way).

Carl

OK, it's taken me a little while to get to the bottom of this, but here is what went wrong. The project started life on VS2012 with .Net 4.5. I then went through various upgrades to VS2012 update 5, latest version of NuGet, .Net 4.6.2. When that didn't work, I spun up a development machine on Azure with VS2015 (update 3 and .Net 4.6.2) and moved the project over but that still didn't work.

The problem was that there were too many dependencies that tagged along from the original project. The answer was to start a fresh project on the Azure machine, copy my code over and then install the various Azure packages - it worked first time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM