I just migrated an ASP.Net Core 1.1 application to the new 2.0 version that was just released. Now I get the following exception:
System.BadImageFormatException: 'Could not load file or assembly 'dotnet-aspnet-codegenerator-design' or one of its dependencies. An attempt was made to load a program with an incorrect format.'
The exception is thrown on the following line (AddMvc
):
public IServiceProvider ConfigureServices(IServiceCollection services)
{
...
services.AddMvc(options =>
{
options.Filters.Add(new MiddlewareFilterAttribute(typeof(LocalizationPipeline)));
})
.AddJsonOptions(options =>
{
// Maintain property names during serialization. See:
// https://github.com/aspnet/Announcements/issues/194
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
})
.AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix)
.AddDataAnnotationsLocalization();
}
I'm targeting the .Net Framework 4.7, using AnyCPU
target platform. I'm using the win10-x64
RID if this is of any help.
Every Nuget package is up to date etc.
Any idea? I've got no luck by googling.