"Unable to satisfy package dependency constraints" with Breeze.Server.WebAPI2 - breeze

I am trying to add the Breeze.Server.WebAPI2 Nuget package to Visual Studio Community 2015 RC. When I click on install I get "Unable to satisfy package dependency constraints"
The listed dependencies are:
Microsoft.AspNet.WebApi.OData (>= 5.2.2 && < 6.0.0)
Microsoft.AspNet.WebApi.WebHost (>= 5.2.2 && < 6.0.0)
Breeze.Server.ContextProvider (=1.5.4)
WebActivator
I tried adding the missing dependencies using their own packages, and now my packages.config looks like this:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Breeze.Server.ContextProvider" version="1.5.4" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.WebApi.OData" version="5.5.1" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" userInstalled="true" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" userInstalled="true" />
<package id="System.Spatial" version="5.6.0" targetFramework="net452" userInstalled="true" />
<package id="WebActivatorEx" version="2.0.6" targetFramework="net452" userInstalled="true" />
</packages>
But I still get the same error
EDIT
To get around the problem I downloaded Visual Studio 2013 Express and used it to create the project and add the package. Then I added the project to Visual Studio 2015. Untidy, but I'm up and running.

Two points to this response:
Firstly, according to the NuGet Package Manager GitHub issue tracker, the message you have received is a known issue, in that the identity of the problematic package should have been included in the error message, rather than the generic 'Unable to satisfy package dependency constraints'.
https://github.com/NuGet/Home/issues/241
As indicated in the Issue tracker, this has been resolved, but the version of the NuGet Client that includes the fix has not yet been released.
I have observed the same behaviour for other packages with Visual Studio 2015 RC, for which the latest NuGet Package Manager client (as of writing) is 3.0.60410.213.
While debugging this error on other packages, it led me to a potential resolution:
Secondly By default the NuGet Package Manager in Visual Studio 2015 RC is set to install packages with the Dependency Resolution behaviour set to 'lowest'. In one or two cases where I have encountered the "Unable to satisfy package dependency constraints" error, adding a package with Dependency Resolution behaviour set to 'highest' has resolved this issue, presumably due to either incorrect dependencies specified in the parent NuSpec manifest, or incompatibilities as specified in the dependency graphs manifests.
One example of the latter a higher version of a package is installed in Visual Studio 2015 RC project templates than is supported by a third-party package in the dependency chain. The NuGet bug fix mentioned above should make identifying these situations much easier.

I had the same problem, I had Nuget version 3.0.60410.213. I was trying to install EasyNetQ but I kept getting that error also. I tried using "highest" in Dependency Resolver, but no cigar.
My solution was to install the dependency individually. I installed the RabbitMQ.Client package, then EasyNetQ would install.

Related

Creating a new package and adding it ot nuget source in Visual Studio

I have a Asp.Net MVC solution, that needs to be added as a Nuget package, which can be used as a shared component by internal applications.
I have googled a bit and found that we can create a nuget package only by using a class library. project.
In my case how can I create a nuget package using a web application ? Or should I create a class library project referencing the the Asp.Net MVC application dll ?
Previously this whole application as a dll was referenced by other components/ projects. Now I need to move this dll to the nuget source so that it can be still used by other projects by downloading it from nuget manager.
Thanks in advance.
You can add a .nuspec file defining your dll and its dependencies and add a post build call to create the package.
Example nuspec file:
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd" >
<metadata>
<id>myproductid</id>
<version>$version$</version>
<title>some title</title>
<authors>me</authors>
<owners>myself</owners>
<projectUrl>http://www.example.com</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>...</description>
<releaseNotes>First nuget release.</releaseNotes>
<copyright>Copyright 2020</copyright>
<dependencies>
<dependency id="AutoMapper" version="9.0.0" />
<dependency id="jQuery" version="3.3.1" />
<dependency id="Microsoft.AspNet.Mvc" version="5.2.7" />
<dependency id="Microsoft.AspNet.Razor" version="3.2.7" />
<dependency id="Newtonsoft.Json" version="12.0.2" />
<dependency id="System.Reflection.TypeExtensions" version="4.6.0" />
</dependencies>
</metadata>
<files>
<file src="bin\My.WebApplication.dll" target="lib\net461" />
</files>
</package>
The post build event, in my case, looks like this:
if ($(Configuration)) == (Release) nuget pack "$(ProjectPath)" -Prop Configuration=Release -OutputDirectory "K:\nuget"

ASP.NET MVC NavBar does not display unless inspecting elements

I've recently started doing some experimenting to gain experience with ASP.NET MVC. My commercial experience has been with WinForms, so it's proving a challenge (but interesting)
My starting point has been to use a guide from Microsoft:
MVC Getting Started
The guide is written with ASP.NET Core in mind, however, I'm using .NET 4.5. I've found some differences with the way HML is generated (HttpUtility.HtmlEncode) but nothing too major.
I've created an ASP.NET MVC5 project and started to play around with adding new controllers. The strange thing I've noticed is that the NAvBar is not visible:
The strange thing is that (when running with Chrome), I can see and interact with the NavBar
I've created a fresh project to make sure that none of the changes I made were responsible, "out of the box" I see the same behavior.
The following NuGet packages are installed in the project:
<package id="Antlr" version="3.5.0.2" targetFramework="net452" />
<package id="bootstrap" version="3.3.7" targetFramework="net452" />
<package id="DanielSnowden.CommonLibrary" version="1.0.0.4" targetFramework="net452" />
<package id="jQuery" version="3.1.1" targetFramework="net452" />
<package id="jQuery.Validation" version="1.16.0" targetFramework="net452" />
<package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net452" />
<package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.7" targetFramework="net452" />
<package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.2.0" targetFramework="net452" />
<package id="Microsoft.ApplicationInsights.PerfCounterCollector" version="2.2.0" targetFramework="net452" />
<package id="Microsoft.ApplicationInsights.Web" version="2.2.0" targetFramework="net452" />
<package id="Microsoft.ApplicationInsights.WindowsServer" version="2.2.0" targetFramework="net452" />
<package id="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" version="2.2.0" targetFramework="net452" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.3" targetFramework="net452" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net452" />
<package id="Microsoft.Net.Compilers" version="2.0.1" targetFramework="net452" developmentDependency="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
<package id="Modernizr" version="2.8.3" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
<package id="Respond" version="1.4.2" targetFramework="net452" />
<package id="WebGrease" version="1.6.0" targetFramework="net452" />
All packages appear to be up to data as I can't see any updates. I've tried viewing the website (through IIS local) in both Chrome and Edge. My Visual Studio version is 2017 (Community) and I'm running on a Windows 10 host.
I've tried to research the issue, but can't seem to find much information. However, I suspect that (as usual) I'm overlooking something perfectly obvious.
Does anyone have any suggestions?
The NavBar is a feature only visible in the mobile layout.
Chrome provides the ability to simulate viewing on a number of different mobile devices. When inspecting elements, Chrome was defaulting to one of these devices.

How disable nuget package restore when adding new MVC5 Views

In a MVC project using Visual Studio 2015, i have configured the references to use dlls without using nuget. But when i'm adding a new view (MVC5 View Page, MVC5 Partial Page, etc), visual studio automatically add nuget packages to the project that are already referenced. Why? Is there a way to disable nuget completly?
Using Add -> View, my references are not altered and the packages are not downloaded
Using Add -> MVC5 View Page, MVC Partial View or the other ones, Visual Studio add a packages.config and change the references to the newly downloaded libraries
Here's the package that VisualStudio add when i'm adding a new View :
<packages>
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
</packages>
I have the latest version of Visual Studio 2015 with Update 2 but this behaviour was there before the update
I added the line <RestorePackages>false</RestorePackages> to the project file without success

MvvmCross SQLite.Net-PCL plugin missing assembly

So i've added the "MvvmCross.HotTuna.Plugin.SQLitePCL" version "4.0.0-beta6" to my solution (My core, my android and my iphone projects).
I can now use SQLite.Net, and i can build for android and iPhoneSimulator. However, as soon as I switch to "iPhone" as my target, I get the following error:
Failed to resolve assembly: 'SQLite.Net.Platform.XamarinIOS, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' SimplyRemember.Touch
It makes sense that it cannot find this assembly, as it is indeed not listed under "References" - Only the "SQLite.Net.Platform.XamarinIOS.Unified" is. Notice the ".Unified".
I have tried cleaning my solution. I have tried wiping my "/Library/Caches/Xamarin/mtbs" folder. I have tried wiping my "packages" folder in my solution, and restoring all packages. Same result every time.
As a sidenote, this was also the case when i used SQLitePCL version "4.0.0-beta5" in which i had added its dependencies to SQLite.Net-PCL 3.0.5 and SQLite.Net.Async-PCL 3.0.5 manually
Full packages.config for my Touch project:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Acr.Support" version="1.0.2" targetFramework="xamarinios1" />
<package id="Acr.UserDialogs" version="4.1.8" targetFramework="xamarinios1" />
<package id="MvvmCross.HotTuna.Binding" version="4.0.0-beta5" targetFramework="xamarinios1" />
<package id="MvvmCross.HotTuna.CrossCore" version="4.0.0-beta5" targetFramework="xamarinios1" />
<package id="MvvmCross.HotTuna.MvvmCrossLibraries" version="4.0.0-beta5" targetFramework="xamarinios1" />
<package id="MvvmCross.HotTuna.Plugin.SQLitePCL" version="4.0.0-beta6" targetFramework="xamarinios1" />
<package id="MvvmCross.HotTuna.StarterPack" version="4.0.0-beta5" targetFramework="xamarinios1" />
<package id="Splat" version="1.6.2" targetFramework="xamarinios1" />
<package id="SQLite.Net.Async-PCL" version="3.1.1" targetFramework="xamarinios1" />
<package id="SQLite.Net-PCL" version="3.1.1" targetFramework="xamarinios1" />
<package id="StyleCop.Analyzers" version="1.0.0-beta014" targetFramework="xamarinios1" developmentDependency="true" />
</packages>

MVC4 Bundling slow when using Scripts.Render

My asp.net MVC4 web project is running very slowly when serving a simple page that renders bundled scripts. However, when I use a 'hardcoded' script tag on the page with the source attribute of the virtual bundle path then performance is much better:
#Scripts.Render("~/bundles/scripts") ~ 4 seconds
vs
<script src='#Scripts.Url("~/bundles/scripts")'></script> < 1 second
My BundleConfig.cs has no special configuration, this is exactly as it appears:
bundles.Add(new ScriptBundle("~/bundles/scripts").Include(
"~/Scripts/jquery-1.7.2.min.js",
"~/Scripts/jquery.validate.min.js",
"~/Scripts/jquery.validate.unobtrusive.js",
"~/Scripts/jquery-ui-1.9.0.custom.min.js",
"~/Scripts/bootstrap.min.js",
"~/Scripts/bootstrap-modal.js",
"~/Scripts/bootstrap-dropdown.js",
"~/Scripts/bootstrap-tooltip.js",
"~/Scripts/bootstrap-typeahead.js",
"~/Scripts/bootstrap-transition.js",
"~/Scripts/bootstrap-popover.js"));
My web.config is even configured to optimize in Debug but I have tried running in Release mode and still get the same result:
<compilation optimizeCompilations="true" debug="false" targetFramework="4.0" />
Any ideas why Scripts.Render is so slow?
The problem was with the outdated package I had installed. A simple Update-Package in package manager console and I went from
<package id="Microsoft.AspNet.Web.Optimization"
version="1.0.0-beta2" targetFramework="net40" />
to
<package id="Microsoft.AspNet.Web.Optimization"
version="1.0.0" targetFramework="net40" />
Now Scripts.Render() is peforming much better :-)

Resources