ASP.NET Core MVC X.PagedList.Mvc.Common is not installed - pagination

I was using PagedList in my ASP.NET MVC 4 Application and now we are migrating to ASP.NET Core 6 MVC. So I am migrating PagedList.MVC to X.PagedList.Mvc.Core.
I installed X.PagedList.Mvc.Core version 8.4.5
I the view I added:
#using X.PagedList.Mvc.Core;
#using X.PagedList;
#using X.PagedList.Mvc.Common;
But X.PagedList.Mvc.Common does not exist...
I get an error:
CS0234: The type or namespace name 'Common' does not exist in the namespace X.PagedList.Mvc are you missing and Assembly reference
I checked and the last version that has X.PagedList.Mvc.Common is in version 7.9.
I need to use properties and attributes like Mvc.Common.PagedListRenderOptions and UpdateTargetId
that are not available in this version...
There is a way to replace it? How can be used with this version?
Thanks

PagedListRenderOptions class is under the namespace X.PagedList.Web.Common;instead of X.PagedList.Mvc.Common,there's no X.PagedList.Mvc.Common namespace now

Related

OpenIdConnectOptions Missing from .net core sample application on linux

I am trying to follow this tutorial for Azure AD authentication in a .NET core web app:
https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/aspnetcore2-2
and I get this error:
The type or namespace name 'OpenIdConnectOptions' could not be found (are you missing a using directive or an assembly reference?)
I am using Linux and have no issue getting the basic templates to generate and build, the issue appears to arise where the tutorial says to add this line:
services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, options =>
{
options.Authority = options.Authority + "/v2.0/";
options.TokenValidationParameters.ValidateIssuer = false;
});
I have tried adding packages (semi randomly) e.g.:
Microsoft.IdentityModel.Protocols.OpenIdConnect
Microsoft.Owin.Security.OpenIdConnect
to no avail as the error persists and I get new issues like:
Error: Package 'Microsoft.Owin 4.0.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.
I am not sure if I am missing some basics with authentication and running .net core on linux, I am new to this and just trying to get the ball rolling with a working demo that actually does something :)
I have not checked on linux yet, but the nuget package you are missing should be produced by ASP.NET Core from the following project: https://github.com/aspnet/AADIntegration. Did you try to update the latest nuget package of ASP.NET Core ?
As a workaround you might want to have a look at the following branch of the sample (which still has the code which was now moved to ASP.NET Core AADIntegration) : https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master
ran into the same issue. After installing these modules, it compiled.

IAppBuilder could not be found

I read the previous posts - Tried a few things.
Here is the issue
A simple console OWIN self host app - Not much in there
public void Configuration(IAppBuilder appBuilder)
does not compile.
1. If I say using Microsoft.Owin and using Owin, then I get an error the using directive for owin already appeared. I can't figure out why.
2. If I do using Microsoft.Owin but modify the use as Owin.IAppBuilder
then the compiler says it can't find owin.IAppBuilder.
Yes I tried reinstalling Microsoft.Owin
and Owin (3 times)
I checked the project reference 4.5.1
Here is an issue to consider.
If your using statements are insider a namespace declaration
And your name space starts with Microsoft (for whatever reasons)
Then using Owin ==> looks at Microsoft.Owin
The solution is to use using global::Owin;

Why does ServiceStack v3.9.28 nuget not contain SqlServerStorage class for MiniProfiler

I used the nuget command to get the ServiceStack dll's. The 3.9.28 I have does not contain the SqlServerStorage class in the MiniProfiler namespace. Why is that?
ServiceStack includes a port of MiniProfiler that's integrated to work with ServiceStack. To remove conflicts ServiceStack's port is kept under the ServiceStack.MiniProfiler namespace at which place you will find the SqlServerStorage.cs class.

Where is ServiceStack.Data.SqlMapper.QueryMultiple and ServiceStack.Data.DynamicParameters

I recently upgraded ServiceStack related libraries (specially ServiceStack 2.9.25), and with previous releases we had ServiceStack.Data namespace and we were using ServiceStack.Data.DynamicParameter class and IDbConnection extension methods such as Execute and QueryMultiple. But in latest version we don't have this namespace so as the above classes and methods. Are these moved to somewhere else and any alternative classes/methods to use?
SqlMapper / Dapper has now moved to ServiceStack.Razor.Dapper namespace which is in the ServiceStack.Razor project.

The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft'

I'm trying to make a C# console app that adds messages to a queue. I'm following the examples about Azure Service Bus given here: http://www.windowsazure.com/en-us/develop/net/how-to-guides/service-bus-queues/
My program does nothing at the moment:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Messaging;
namespace testConsole
{
class Program
{
static void Main(string[] args)
{
}
}
}
The problem I'm having is that when I add the Microsoft.ServiceBus.dll reference (as explained in the above link, 1-add dll reference and 2-add using statements) I'm getting an error upon compiling: "The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)"
I even looked into the Microsoft.ServiceBus.dll with reflector tool and it does contain Microsoft.ServiceBus namespace. Version number of the dll is 1.6.0.0 and runtime version v4.0.30319.
Any help appreciated.
-pom-
A common issue when using Storage and AppFabric services with a non-web applications is that the default Target Framework for Windows Forms app and Console App is .NET Framework 4.0 Client Profile. Change your project's Target Framework to ".NET Framework 4.0" (full) and it will work.
The problem that I've was that there are two packages Microsoft.Azure.ServiceBus and Azure.Messaging.ServiceBus. and I was using the wrong one, so maybe was that.
In the link the package used it's Azure not Microsoft as you are importing in your project.
It's this one
using Azure.Messaging.ServiceBus;

Resources