question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: processor architecture mismatch

See original GitHub issue

Hiya,

The MSSQL provider faults with a weird error:

warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Users\31611\.nuget\packages\serilog.ui.mssqlserverprovider\2.1.0\lib\netstandard2.0\Serilog.Ui.MsSqlServerProvider.dll", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

Perhaps this is because of the following props in the .csproj?:

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <PlatformTarget>x64</PlatformTarget>
    <WarningLevel>0</WarningLevel>
  </PropertyGroup>

I’m running a net6 project that looks like this:

<Project Sdk="Microsoft.NET.Sdk.Web">

	<PropertyGroup>
		<TargetFramework>net6.0</TargetFramework>
		<UserSecretsId>0844be79-0a19-44df-845c-fdb74a50cfb0</UserSecretsId>
		<RootNamespace>Comp.WebApi</RootNamespace>
		<ImplicitUsings>enable</ImplicitUsings>
	</PropertyGroup>

	<PropertyGroup>
		<GenerateDocumentationFile>true</GenerateDocumentationFile>
		<NoWarn>$(NoWarn);1591</NoWarn>
	</PropertyGroup>

	<PropertyGroup>
		<!-- See: https://docs.microsoft.com/en-us/aspnet/core/web-api/advanced/analyzers?view=aspnetcore-5.0&tabs=visual-studio -->
		<IncludeOpenAPIAnalyzers>true</IncludeOpenAPIAnalyzers>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="AutoMapper" Version="11.0.0" />
		<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
		<PackageReference Include="Hangfire.AspNetCore" Version="1.7.28" />
		<PackageReference Include="Hangfire.Console" Version="1.4.2" />
		<PackageReference Include="Hangfire.SqlServer" Version="1.7.28" />
		<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.1" />
		<PackageReference Include="Microsoft.BingAds.SDK" Version="13.0.12" />
		<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
		<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
			<PrivateAssets>all</PrivateAssets>
			<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
		</PackageReference>
		<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
		<PackageReference Include="Microsoft.OData.Client" Version="7.9.4" />
		<PackageReference Include="Serilog.UI" Version="2.1.1" />
		<PackageReference Include="Serilog.UI.MsSqlServerProvider" Version="2.1.0" />
		<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
		<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
		<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.14.1" />
	</ItemGroup>

       ...

</Project>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sommmencommented, Jan 13, 2022

Works - thanks for the effort!

1reaction
mo-esmpcommented, Jan 13, 2022

Please upgrade Serilog.UI.MsSqlServerProvider to version 2.1.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

.net - How do I fix the Visual Studio compile error, "mismatch ...
It tells me to go to Configuration Manager to align my architectures. The C# DLL is set up with platform target x86.
Read more >
There was a mismatch between the processor architecture of ...
This error occurs during a build when more than one version of the same dependent assembly is referenced in a build of the...
Read more >
There was a mismatch between the processor architecture of ...
Technical Article Details : Error: Warning: There was a mismatch between the processor architecture of the project being built.
Read more >
There was a mismatch between the processor architecture of ...
I get the following error when trying to create a store package for my UWP app. Searching for hours now, unable to find...
Read more >
Mismatch between the processor architecture of the project ...
Mismatch between the processor architecture of the project being built “MSIL” and the processor architecture … Question: When building my C# ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found