NET 7 - Identity Server - Unable to load one or more of the requested types. Method 'get_ServerSideSessions' - asp.net-core

Getting the following exception in
app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); }):
System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested types.Method 'get_ServerSideSessions' in type 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext`1' from assembly 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.'
After updating the nuget package Duende.IdentityServer.EntityFramework to version 6.2.0. and Duende.IdentityServer.Storage to 6.2.0. Reverting both package back to 6.0.4 resolves this error , seems like there is an incompatibility introduced. If anyone has a fix so I can upgrade this package is appreciated.

Related

Microsoft.Web.LibraryManager.Configuration.Settings cannot find Newtonsoft.Json package

I have a .NET Core 2.2 project setup in Azure DevOps that uses a CI pipeline to build, and recently, after updating the Microsoft.Web.LibraryManager.Build NuGet package to version 2.1.175 the CI pipeline has been throwing the following exception every time I try and run it:
System.TypeInitializationException: The type initializer for 'Microsoft.Web.LibraryManager.Cache.WebRequestHandler' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Microsoft.Web.LibraryManager.Configuration.Settings' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621)
I've tried installing Newtonsoft.Json NuGet package in the project but am still getting this error.
Is there something I need to be adding to the pipeline, or something that I need added to the project itself to resolve this?

Apache Ignite .Net Core failed to start

Apache ignite .net core server node fails to start with below error, any idea what could be the reason?
Apache.Ignite.Core.Binary.BinaryObjectException
HResult = -2146233088,
Message = Unexpected field type [pos=42559, expected=String, actual=0]
StackTrace:
class org.apache.ignite.binary.BinaryObjectException: Unexpected field type [pos=42559, expected=String, actual=0]
at org.apache.ignite.internal.binary.BinaryReaderExImpl.checkFlagNoHandles(BinaryReaderExImpl.java:1684)
at org.apache.ignite.internal.binary.BinaryReaderExImpl.readString(BinaryReaderExImpl.java:1058)
at org.apache.ignite.internal.processors.platform.utils.PlatformConfigurationUtils.readDataRegionConfiguration(PlatformConfigurationUtils.java:2303)
at org.apache.ignite.internal.processors.platform.utils.PlatformConfigurationUtils.readDataStorageConfiguration(PlatformConfigurationUtils.java:2082)
at org.apache.ignite.internal.processors.platform.utils.PlatformConfigurationUtils.readIgniteConfiguration(PlatformConfigurationUtils.java:919)
at org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetConfigurationClosure.processPrepareResult(PlatformDotNetConfigurationClosure.java:195)
at org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetConfigurationClosure.prepare(PlatformDotNetConfigurationClosure.java:182)
at org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetConfigurationClosure.apply0(PlatformDotNetConfigurationClosure.java:110)
at org.apache.ignite.internal.processors.platform.PlatformAbstractConfigurationClosure.apply(PlatformAbstractConfigurationClosure.java:50)
at org.apache.ignite.internal.processors.platform.PlatformAbstractConfigurationClosure.apply(PlatformAbstractConfigurationClosure.java:27)
at org.apache.ignite.internal.processors.platform.PlatformAbstractBootstrap.start(PlatformAbstractBootstrap.java:40)
at org.apache.ignite.internal.processors.platform.PlatformIgnition.start(PlatformIgnition.java:74)
NOTE:This error only occuring in Apache Ignite 2.12.0 and code working fine in the previous versions.
An error like this happens due to a mismatch of .NET binaries and Java jar files.
Try deleting bin and obj directories and performing a clean rebuild.

Can't Deploy Sitefinity on my local machine

I am trying to install the trail version of Sitefinity but running into this error
Server Error in '/' Application.
________________________________________
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'MySql.ConnectorInstaller, Version=6.10.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 284: <siteMap>
Line 285: <providers>
Line 286: <add name="MySqlSiteMapProvider" type="MySql.Web.SiteMap.MySqlSiteMapProvider, MySql.ConnectorInstaller, Version=6.10.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" />
Line 287: </providers>
Line 288: </siteMap>
Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config Line: 286
Assembly Load Trace: The following information can be helpful to determine why the assembly 'MySql.ConnectorInstaller, Version=6.10.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2623.0
I see the database was made though I choose SQL Sever not mysql, so I am not sure why this error is talking about MySql.
Looks like the error is coming from your machine.config file. I definitely don't have that value in neither machine.config nor the Sitefinity's web.config file.
Maybe try deleting it and restart IIS.

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]

While my .NET Core application is running, I noticed the following line:
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: Method 'Clone' in type 'Microsoft.EntityFrameworkCore.Infrastructure.Internal.SqlServerOptionsExtension' from assembly 'Microsoft.EntityFrameworkCore.SqlServer, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation. System.TypeLoadException: Method 'Clone' in type 'Microsoft.EntityFrameworkCore.Infrastructure.Internal.SqlServerOptionsExtension' from assembly 'Microsoft.EntityFrameworkCore.SqlServer, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.
I'm just curious what's causing this error because my apps is still running fine despite the error message.
By the way, I'm using .NET Core 2.0.0 Preview 1 version.
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware is just the middleware catching exceptions when nothing else in your program did
So your "real" exception is
Method 'Clone' in type 'Microsoft.EntityFrameworkCore.Infrastructure.Internal.SqlServerOptionsExtension' from assembly 'Microsoft.EntityFrameworkCore.SqlServer, ...' does not have an implementation
By doing some googling with this exception, it seems to get down to support of your .Net Core version vs your EF Provider
If you want more information, you can:
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-2.1#the-developer-exception-page Enable Developer Exception pages
Log more information from EF (https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-2.1#add-providers => enable in trace mode will get you more information)

Can't compile ASP.NET 5 Web API when adding XML support

I'm trying to figure out how ASP.NET 5 Web API supports Content Negotiation. In order to support XML (in addition to the default JSON support), according to another answer here on Stack Overflow, I need to add that support from an optional NuGet package.
Things have changed a bit since that answer, but I pulled down the Microsoft.AspNet.Mvc.Xml package and edited my Startup.cs file:
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc().AddMvcOptions(options =>
{
options.InputFormatters.Add(new XmlSerializerInputFormatter());
});
}
This, however, doesn't compile:
The type 'InputFormatter' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null'.
Here are the full compilation error messages:
1>C:\Users\mark\Desktop\WebApplication1\src\WebApplication1\Startup.cs(33,17,33,44): DNX 4.5.1 error CS0012: The type 'InputFormatter' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null'.
1>C:\Users\mark\Desktop\WebApplication1\src\WebApplication1\Startup.cs(33,45,33,78): DNX 4.5.1 error CS1503: Argument 1: cannot convert from 'Microsoft.AspNet.Mvc.Xml.XmlSerializerInputFormatter' to 'Microsoft.AspNet.Mvc.Formatters.IInputFormatter'
1>C:\Users\mark\Desktop\WebApplication1\src\WebApplication1\Startup.cs(33,17,33,44): DNX Core 5.0 error CS0012: The type 'InputFormatter' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.AspNet.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null'.
1>C:\Users\mark\Desktop\WebApplication1\src\WebApplication1\Startup.cs(33,45,33,78): DNX Core 5.0 error CS1503: Argument 1: cannot convert from 'Microsoft.AspNet.Mvc.Xml.XmlSerializerInputFormatter' to 'Microsoft.AspNet.Mvc.Formatters.IInputFormatter'
The error message seems fairly clear, but the project already includes Microsoft.AspNet.Mvc.Core, although not quite in the desired version:
Id Versions
-- --------
Microsoft.AspNet.IISPlatformHandler {1.0.0-rc1-final}
Microsoft.AspNet.Mvc {6.0.0-rc1-final}
Microsoft.AspNet.Mvc.Core {6.0.0-rc1-final}
Microsoft.AspNet.Mvc.Xml {6.0.0-beta5}
Microsoft.AspNet.Server.Kestrel {1.0.0-rc1-final}
Microsoft.AspNet.StaticFiles {1.0.0-rc1-final}
Microsoft.Extensions.Configurati... {1.0.0-rc1-final}
Microsoft.Extensions.Configurati... {1.0.0-rc1-final}
Microsoft.Extensions.Logging {1.0.0-rc1-final}
Microsoft.Extensions.Logging.Con... {1.0.0-rc1-final}
Microsoft.Extensions.Logging.Debug {1.0.0-rc1-final}
As I'm writing this, ASP.NET 5 is only available in a Release Candidate version, so the above packages are the most recent available.
Clearly, Microsoft.AspNet.Mvc.Core 6.0.0.0 isn't available. In a normal .NET project, I'd attempt to solve this issue with a binding redirect, but since this is ASP.NET 5, that's apparently no longer the way to do things.
How can I make my code compile?
I believe you have to use the Microsoft.AspNet.Mvc.Formatters.Xml package instead. Also see this issue on github.
Also a hot tip: Use http://packagesearch.azurewebsites.net/ to search for which NuGet-package contains the class you are looking for.