cefsharp / CefSharp

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
http://cefsharp.github.io/
Other
9.89k stars 2.92k forks source link

I have the referencing assembly set to compile as x64 #1898

Closed StingyJack closed 7 years ago

StingyJack commented 7 years ago

... and its telling me i still have the assembly set to AnyCPU. This may just be a simple misunderstanding on my part, but I read through the whole faq and a few threads and it looks like your warning is on the solution configuration platform name and not the actual assembly platform target (which can be different). I think the assembly bitness is what you want to be targeting, no?

image

Dunno. Not really important.

merceyz commented 7 years ago

Look at the toolbar, set that to x64 or x86, if it isn't there. Add it

StingyJack commented 7 years ago

Thats a solution configuration - not the bitness (x86 or x64) of the assembly. Assemblies care about bitness, else you get an Image Format exception.

amaitland commented 7 years ago

You have to make changes on the solution level. Or just implement the code required for AnyCpu support.

If you don't like it submit a PR.

merceyz commented 7 years ago

Thats a solution configuration - not the bitness (x86 or x64) of the assembly. Assemblies care about bitness, else you get an Image Format exception.

I am well aware, but as you've set the platform target to x64 you need to set it solution wide as well (as @amaitland said). NuGet will take care of the rest.

Also, in the screenshot your full name is visible, you may or may not want to change that.

StingyJack commented 7 years ago

@merceyz thanks for the ident heads up. I've changed it to my birth name to avoid any confusion. =P

I guess I just don't follow the series of events that leads to this. One of the solutions I manage at work has about 200 projects, and a few of the projects need to reference Sap and Oracle issued assemblies. I only had to make the referencing project chain x64, not all the projects in the solution, and didnt have to change the solution platform (and with it about 180 projects - we did eventually do this).

I'm not trying to grief any you, and I don't really want AnyCPU (or even the project I was looking at that referenced this one). The inspection in msbuild simply didn't align with the error message I was seeing, and after reading the FAQ and the issues and through the cef# code it looked like a simple misunderstanding of solution platform vs assembly platform, but maybe its more complex than that and you don't feel like explaining. That's up to you, but I don't think you mean for the below to be able to happen.

image

$p$g>corflags slackui.exe  
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.6.1055.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32
CorFlags  : 0x3
ILONLY    : 1
**32BITREQ  : 1**
32BITPREF : 0
Signed    : 0

$p$g>corflags CefSharp.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.6.1055.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32+
CorFlags  : 0x9
ILONLY    : 1
**32BITREQ  : 0**
32BITPREF : 0
Signed    : 1

$p$g>corflags CefSharp.Core.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.6.1055.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32+
CorFlags  : 0x18
ILONLY    : 0
**32BITREQ  : 0**
32BITPREF : 0
Signed    : 1
amaitland commented 7 years ago

The message your seeing is generated by an msbuild targets file see https://github.com/cefsharp/CefSharp/blob/master/NuGet/CefSharp.Common.targets#L3

The Platform property is currently used, if you are familiar with msbuild then by all means improve the checks and submit a PR :+1: