Error while installing nuget package nuget package Kentor.OwinCookieSaver - asp.net

I have ASP.NET MVC 5 application with .NET 4.5.1. The application is having issue as described in this SO post.
So as per the suggestion i am trying to install https://github.com/Sustainsys/owin-cookie-saver nuget package However i am getting error
Severity Code Description Project File Line Suppression State
Error Could not install package 'Kentor.OwinCookieSaver 1.1.1'. You
are trying to install this package into a project that targets
'.NETFramework,Version=v4.5.1', 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. 0
any idea?

Right now, the ASP.NET MVC 5 app you have is targeting .NET 4.5.1. No surprise there. The error says "You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.1', but the package does not contain any assembly references or content files that are compatible with that framework."
The highlighted line indicates that the package you are trying to install is not built for .NET 4.5.1. I went ahead and downloaded the package itself (from NuGet.org). The package is currently targeting .NET 4.5.2. So if you change your target framework to .NET 4.5.2 and try to install, you will find it works out for you.
Ideally, packages available to the public would be built for a wider range of Target Frameworks but occasionally I do run into this. If you run into this again, go grab the package from the previous link (see the Manual Download on the right hand side of the page). Open up the .nupkg using 7-zip and open up the lib folder. There you will find what frameworks it is targeting and can adjust accordingly (or decide to try another package if you can't change).

Related

SignalR on Mono (Linux Ubuntu)

I am having a hard time referencing the SignalR in my ASP.Net (4.5) application that I run on Mono (Linux Ubuntu). When I tries to add SignalR from nuget packages, then I get the following error: "Could not install package 'jQuery 1.6.4'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', 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." Then I tried to install SignalR from source. I followed the instruction given on this page https://github.com/SignalR/SignalR to install SignalR. After that, I created a sample project as described here: https://learn.microsoft.com/en-us/aspnet/signalr/overview/getting-started/tutorial-getting-started-with-signalr#setup. However, when I open my browser it says that could not be found (this is the script referenced in my index.html file). I couldn't find that file, it seems this file is autogenerated. I am really stuck on this issue, not sure how to resolve it.
Not sure what I am doing wrong. I followed the same tutorial (https://learn.microsoft.com/en-us/aspnet/signalr/overview/getting-started/tutorial-getting-started-with-signalr#setup) on windows and it worked fine.

Error installing System.IdentityModel.Token.Jwt in Xamarin.Forms

I'm trying to use the System.IdentityModel.Token.Jwt NuGet package for my Xamarin.Forms app. When I try to add the package to my PCL, it installs in my Android and iOS projects, but I get the following error when adding it to the shared code project:
Could not install package 'System.IdentityModel.Tokens.Jwt 5.1.3'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.6,Profile=Profile44', 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.
Does anyone know how to get around this? I think it has to do with what my project targets but I've tried a few combinations and all of them have produced the same error, just with a different profile listed.
Unfortunately the System.IdentityModel.Tokens.Jwt 5.1.3 NuGet package only contains assemblies that support:
.NET Framework 4.5.1
.NET Standard 1.4
No portable class library profile supports .NET Standard 1.4. The highest they support is .NET Standard 1.2.
So unless you can find another NuGet package that does support portable class libraries you are left with trying to compile the Jwt source code for the portable class library profile you need, or converting your portable class library project into a .NET Standard project and target at least 1.4. You should be able to convert your portable class library project into a .NET Standard project in the project options.

asp.net 5 cannot find rc2 nuget packages

I have a simple asp.net 5 web application.
My project.json file contains dependency:
"Microsoft.IdentityModel.Tokens": "5.0.0-rc2-301060021"
When I restore nuget packages, this package is restored well on my machine. project.json file is in source control, but it does not work on other machine. It says that this package is not found.
Anyway, in nuget configuration Im pointing to my local nuget packages repository, which does not even contain asp.net 5 nuget packages. Where all of these packages come from?
RC2 has not yet been made public, we're still on RC1. Here is the roadmap schedule, which indicates sometime this year. If you do somehow have the package on your machine, you could setup another NuGet feed that others on your project could point to -- then simply place the package in there, so it's on shared feed.
Here is some helping documentation that shows you how to do that.

How to get ASP.NET MVC Music Store up and running with Visual Studio 2013/2015?

I want to get MVC Music Store tutorial application up and running with Visual Studio 2013/2015. Here are the steps that I've taken:
downloaded the latest version from Downloads page
unpacked it
opened it with Visual Studio 2013/2015 - got a migration report without errors but with some warnings
tried to build the solution, but it won't build - got a plenty of errors about missing type/namespace like that:
The type or namespace name could not be found (are you missing a using
directive or an assembly reference?)
How do I build and run locally the MVC Music Store project with Visual Studio 2013/2015?
There are two ways:
1) Download and install ASP.NET MVC 3 Tools from the official ASP.NET MVC 3 page or from Microsoft Download Center. It will install the required DLLS into the GAC.
2) Install the corresponding ASP.NET MVC 3 NuGet package into MvcMusicStore project using following command in the Package Manager Console:
Install-Package Microsoft.AspNet.Mvc -Version 3.0.50813.1
or
Install-Package Microsoft.AspNet.Mvc -Version 3.0.20105.1
After using either of the described ways you will be able to successfully build and run the MVC Music Store tutorial application.
Note that these ways are not conflicting with each other, so you may safely install ASP.NET MVC 3 Tools into your OS and install ASP.NET MVC 3 NuGet package into the project.
Install-Package Microsoft.AspNet.Mvc -Version 3.0.20105.1
Worked for me instead of Version 3.0.50813.1
I was running into the same problem as other mentioned here, tried installing the nuget package and was still getting an error.
My solution after following other advice here by installing the nuget package, the key to my solution was to make sure the project targeted "Microsoft Framework 4.0". I.E. Right mouse on the project node in the solution explorer, select properties, and within the "Application" page for the project select ".Net Framework 4.0".
All is working fine for me after this, seems VS was defaulting to 4.5.1.
HTH.
dan d:)

How to obtain System.Web.Http.Tracing.dll?

I read about Web API having its own TraceWriter implementation with 2012.2, for example here, among other sources.
I am now using VS2013 with .NET 4.5.1 and the EnableSystemDiagnosticsTracing is nowhere to be found. It's meant to be defined in the HttpConfigurationTracingExtensions class which resides in the System.Web.Http.Tracing.dll. However, this assembly is nowhere to be found - not in list of assemblies in the Add Reference dialog, not in GAC.
Where is this assembly supposed to come from? Docs say it's part of .NET Framework 4, which I have installed. Also installed the ASP.NET Web API 2 Tracing 5.0.0 NuGet package. Is there some update? Should I re-install .NET Framework?
I know it's not a big deal to implement ITraceWriter myself but it bothers me not to know what happened with the built-in implementation.
Just install needed NuGet Package
Install-Package Microsoft.AspNet.WebApi.Tracing -Version 5.0.0
It's a little bit strange, but it is the right package
http://www.nuget.org/packages/microsoft.aspnet.webapi.tracing
If you installed the Tracing 5.0.0 NuGet package, it should be correctly included in your project. The moment it is installed, I believe a separate text file should open in VS showing the code you should include in your WebApiConfig.cs file.
I haven't created a Web API 2 project from scratch (only upgraded from pre-5.0 to 5.0 projects), but this is the code that should reside in your WebApiConfig.cs file:
// To disable tracing in your application, please comment out or remove the following line of code
// For more information, refer to: http://www.asp.net/web-api
config.EnableSystemDiagnosticsTracing();
And that should be it, if the package is installed correctly, tracing should now be used in your project.

Resources