Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembly 'CefSharp' does not have a strong name #1

Closed
ghost opened this issue Dec 8, 2010 · 12 comments
Closed

Assembly 'CefSharp' does not have a strong name #1

ghost opened this issue Dec 8, 2010 · 12 comments

Comments

@ghost
Copy link

ghost commented Dec 8, 2010

Assembly CefSharp is not usable, 'cause is not signed...
I need binary package with signed assembly! :)

@chillitom
Copy link
Contributor

I've fixed some issues with the project files that should allow you to compile the project yourself using VS2010 (i know you were having trouble), can you give that a try. If it works you could sign the assembly yourself. I've not yet decided on my signing and release strategy but this is likely something I will do in the near future.

see: https://msdn.microsoft.com/en-us/library/6f05ezxy.aspx and set the key file under Properties->Linker->Advanced

@ghost
Copy link
Author

ghost commented Dec 8, 2010

I try. After studio converts project files:
I set treat wchar_t as built in type: No (/Zc:wchar_t-).
And got linking errors:

1>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) referenced in function "bool __cdecl CefRegisterPlugin(struct CefPluginInfo const &)" (?CefRegisterPlugin@@YA_NABUCefPluginInfo@@@Z)
1>libcef_dll_wrapper.lib(transfer_util.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ)
1>libcef_dll_wrapper.lib(post_data_ctocpp.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ)
1>libcef_dll_wrapper.lib(v8handler_cpptoc.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ)
1>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string,class std::allocator >::length(void)const " (__imp_?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) referenced in function "bool __cdecl CefRegisterPlugin(struct CefPluginInfo const &)" (?CefRegisterPlugin@@YA_NABUCefPluginInfo@@@Z)
1>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) referenced in function "bool __cdecl CefRegisterPlugin(struct CefPluginInfo const &)" (?CefRegisterPlugin@@YA_NABUCefPluginInfo@@@Z)
1>libcef_dll_wrapper.lib(transfer_util.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ)
1>libcef_dll_wrapper.lib(post_data_ctocpp.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ)
1>libcef_dll_wrapper.lib(v8handler_cpptoc.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ)
1>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::operator+=(class std::basic_string,class std::allocator > const &)" (__imp_??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) referenced in function "bool __cdecl CefRegisterPlugin(struct CefPluginInfo const &)" (?CefRegisterPlugin@@YA_NABUCefPluginInfo@@@Z)
1>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::operator+=(char const *)" (__imp_??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) referenced in function "bool __cdecl CefRegisterPlugin(struct CefPluginInfo const &)" (?CefRegisterPlugin@@YA_NABUCefPluginInfo@@@Z)
1>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(struct std::basic_string,class std::allocator >::_Has_debug_it)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@U_Has_debug_it@01@@Z) referenced in function "bool __cdecl CefRegisterPlugin(struct CefPluginInfo const &)" (?CefRegisterPlugin@@YA_NABUCefPluginInfo@@@Z)
1>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::basic_string,class std::allocator > const &)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) referenced in function "public: static class std::basic_string,class std::allocator > __cdecl CefStringTraitsUTF16::to_string(struct _cef_string_utf16_t const *)" (?to_string@CefStringTraitsUTF16@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBU_cef_string_utf16_t@@@Z)
1>libcef_dll_wrapper.lib(transfer_util.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::basic_string,class std::allocator > const &)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z)
1>libcef_dll_wrapper.lib(post_data_ctocpp.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::basic_string,class std::allocator > const &)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z)
1>libcef_dll_wrapper.lib(v8handler_cpptoc.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::basic_string,class std::allocator > const &)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z)
1>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) referenced in function "public: static class std::basic_string,class std::allocator > __cdecl CefStringTraitsUTF16::to_string(struct _cef_string_utf16_t const *)" (?to_string@CefStringTraitsUTF16@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBU_cef_string_utf16_t@@@Z)
1>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(char const *,unsigned int)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDI@Z) referenced in function "public: static class std::basic_string,class std::allocator > __cdecl CefStringTraitsUTF16::to_string(struct _cef_string_utf16_t const *)" (?to_string@CefStringTraitsUTF16@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBU_cef_string_utf16_t@@@Z)
1>libcef_dll_wrapper.lib(transfer_util.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(char const *)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) referenced in function "protected: class std::_Tree,class CefStringBase,struct std::less >,class std::allocator const ,class CefStringBase > >,0> >::iterator __thiscall std::_Tree,class CefStringBase,struct std::less >,class std::allocator const ,class CefStringBase > >,0> >::_Insert(bool,struct std::_Tree_nod,class CefStringBase,struct std::less >,class std::allocator const ,class CefStringBase > >,0> >::_Node *,struct std::pair const ,class CefStringBase > const &)" (?_Insert@?$_Tree@V?$_Tmap_traits@V?$CefStringBase@UCefStringTraitsUTF16@@@@V1@U?$less@V?$CefStringBase@UCefStringTraitsUTF16@@@@@std@@V?$allocator@U?$pair@$$CBV?$CefStringBase@UCefStringTraitsUTF16@@@@V1@@std@@@3@$0A@@std@@@std@@IAE?AViterator@12@_NPAU_Node@?$_Tree_nod@V?$_Tmap_traits@V?$CefStringBase@UCefStringTraitsUTF16@@@@V1@U?$less@V?$CefStringBase@UCefStringTraitsUTF16@@@@@std@@V?$allocator@U?$pair@$$CBV?$CefStringBase@UCefStringTraitsUTF16@@@@V1@@std@@@3@$0A@@std@@@2@ABU?$pair@$$CBV?$CefStringBase@UCefStringTraitsUTF16@@@@V1@@2@@Z)
1>libcef_dll_wrapper.lib(post_data_ctocpp.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(char const *)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z)
1>libcef_dll_wrapper.lib(v8handler_cpptoc.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(char const *)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z)
1>libcef_dll_wrapper.lib(transfer_util.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Throw(class stdext::exception const &)" (__imp_?_Throw@std@@YAXABVexception@stdext@@@Z) referenced in function "public: void __thiscall stdext::exception::_Raise(void)const " (?_Raise@exception@stdext@@QBEXXZ)
1>libcef_dll_wrapper.lib(post_data_ctocpp.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Throw(class stdext::exception const &)" (__imp_?_Throw@std@@YAXABVexception@stdext@@@Z)
1>libcef_dll_wrapper.lib(v8handler_cpptoc.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Throw(class stdext::exception const &)" (__imp_?_Throw@std@@YAXABVexception@stdext@@@Z)
1>libcef_dll_wrapper.lib(transfer_util.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ) referenced in function "protected: void __thiscall std::vector,class std::allocator > >::_Insert_n(class std::_Vector_const_iterator,class std::allocator > >,unsigned int,class CefStringBase const &)" (?_Insert_n@?$vector@V?$CefStringBase@UCefStringTraitsUTF16@@@@V?$allocator@V?$CefStringBase@UCefStringTraitsUTF16@@@@@std@@@std@@IAEXV?$_Vector_const_iterator@V?$CefStringBase@UCefStringTraitsUTF16@@@@V?$allocator@V?$CefStringBase@UCefStringTraitsUTF16@@@@@std@@@2@IABV?$CefStringBase@UCefStringTraitsUTF16@@@@@Z)
1>libcef_dll_wrapper.lib(post_data_ctocpp.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ)
1>libcef_dll_wrapper.lib(v8handler_cpptoc.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ)
1>libcef_dll_wrapper.lib(v8handler_cpptoc.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::~_Container_base_secure(void)" (__imp_??1_Container_base_secure@std@@QAE@XZ) referenced in function "protected: __thiscall std::_Container_base_aux_alloc_empty > >::~_Container_base_aux_alloc_empty > >(void)" (??1?$_Container_base_aux_alloc_empty@V?$allocator@V?$CefRefPtr@VCefV8Value@@@@@std@@@std@@IAE@XZ)
1>libcef_dll_wrapper.lib(v8handler_cpptoc.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::_Container_base_secure(void)" (__imp_??0_Container_base_secure@std@@QAE@XZ) referenced in function "protected: __thiscall std::_Container_base_aux_alloc_empty > >::_Container_base_aux_alloc_empty > >(class std::allocator >)" (??0?$_Container_base_aux_alloc_empty@V?$allocator@V?$CefRefPtr@VCefV8Value@@@@@std@@@std@@IAE@V?$allocator@V?$CefRefPtr@VCefV8Value@@@@@1@@Z)

@ghost
Copy link
Author

ghost commented Dec 8, 2010

Oh, i set in project properties platform toolset to v90 and all was done.
Thanks!

@ghost
Copy link
Author

ghost commented Dec 8, 2010

In any way - it's not so good way.

When i compile project with v90 toolset - i got assembly, but it can't be loaded in normal (v4.0) way - "System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information."

Of course adding useLegacyV2RuntimeActivationPolicy="true" solve problem with assembly loading, but it is wrong way for new code.


  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku="client" />
  </startup>

Better if we can use v100 toolset, and support targeting to .net 4 client profile.
I understand, that build way of native dlls very depended from libcef_dll_wrapper, what probably builded with previous versions, and maybe c runtime versions mismatch???

@chillitom
Copy link
Contributor

Chromium and CEF can only be build with VS2005 or VS2008. The only mixed mode assembly is CefSharp itself, I am surprised that building this with VS2010 and v90 isn't enough. Maybe there is a way to set the target framework version though I can't see it in the project settings.

I'll hopefully have a copy of VS2010 available to me in the next couple of weeks at which point I'll give it a try myself.

@ghost
Copy link
Author

ghost commented Dec 8, 2010

Hmm... In my build HandlerAdapter::HandleAfterCreated never executed - and on load i got null reference exception... :(

@ghost
Copy link
Author

ghost commented Dec 8, 2010

I'm fantastic idiot.

  1. I found that i have MSVS2008 installed. :)
  2. I forget call CEF.Initialize...

For now no any problems.

PS: May be wrong: RaiseConsoleMessage doesn't check that ConsoleMessageEventHandler attached. Also HandlerAdapter create message object even if it is really dosn't not needs.

@chillitom
Copy link
Contributor

glad to hear it's working.

yeah I thought that as well when I first started code C++/CLI, but if you disassemble the generated raise_ConsoleMessage method you can see that if performs a null check in there for you. An unsual case where C++/CLI is more forgiving than C#.

.method family hidebysig specialname instance void 
        raise_ConsoleMessage(object value0,
                             class CefSharp.ConsoleMessageEventArgs value1) cil managed
{
  // Code size       21 (0x15)
  .maxstack  3
  .locals ([0] class CefSharp.ConsoleMessageEventHandler '<tmp>')
  IL_0000:  ldnull
  IL_0001:  stloc.0
  IL_0002:  ldarg.0
  IL_0003:  ldfld      class CefSharp.ConsoleMessageEventHandler CefSharp.BrowserControl::'<backing_store>ConsoleMessage'
  IL_0008:  stloc.0
  IL_0009:  ldloc.0
  IL_000a:  brfalse.s  IL_0014
  IL_000c:  ldloc.0
  IL_000d:  ldarg.1
  IL_000e:  ldarg.2
  IL_000f:  callvirt   instance void CefSharp.ConsoleMessageEventHandler::Invoke(object,
                                                                                 class CefSharp.ConsoleMessageEventArgs)
  IL_0014:  ret
} // end of method BrowserControl::raise_ConsoleMessage

see the branch at IL_000a

@ghost
Copy link
Author

ghost commented Dec 8, 2010

Cool! :)

I have 2 questions:

  1. May be BrowserControl have sense do more like as WebBrowser? For example Load vs Navigate, events... etc.
  2. Generated events require Invoke, but it is Control and control can handle this internally.
  3. Needs event to say that browser is actually ready, and may be wait or throw user-friendly messages in dependend methods. Now Load method throw nullreference exception, if it is executed before internal CEF loop executed HandleAfterCreated. It is usefuly in situations, when i can't use new BrowserControl(url), and use new BrowserControl(), and then (after short period) simply call .Load(url).
  4. I don't understand why i got browser uninitialized, when i call in OnLoad method and CEF.Initialize, then create control - looks like CEF loop dosn't executed immediately...

@chillitom
Copy link
Contributor

All good points.. I'm actually working on number 3 at the moment but frames are making it tricky.

Could you do me a favour and open individual issues for each of these suggestions? That'd be superb, this issue is getting a bit off topic.

@ghost
Copy link
Author

ghost commented Dec 8, 2010

Okay, i create issues, but little later.

@chillitom
Copy link
Contributor

Issue fixed thanks to fddima.

kppullin referenced this issue in kppullin/CefSharp Nov 8, 2011
mwisnicki pushed a commit to mwisnicki/CefSharp that referenced this issue Aug 2, 2012
Ignore intellisense files and Debug directory - thanks to mwisnicki
perlun pushed a commit that referenced this issue Feb 21, 2014
Further refinements of the comments
jornh pushed a commit that referenced this issue May 30, 2014
Add nuget.org as package source for xunit @appveyor
amaitland pushed a commit that referenced this issue Apr 10, 2015
mmv referenced this issue in OutSystems/CefSharp May 13, 2015
Merge back changes already in pull requests to cefsharp/CefSharp
amaitland pushed a commit that referenced this issue Jul 7, 2015
amaitland pushed a commit that referenced this issue Dec 9, 2015
Merge from focus-changed-1256 to master.
amaitland pushed a commit that referenced this issue Sep 13, 2016
amaitland added a commit that referenced this issue Apr 18, 2017
… should use SetAsChild method instead (I know the example is incomplete, contributions welcome).

newBrowser should only be used in WPF/OffScreen
GerHobbelt pushed a commit to GerHobbelt/CefSharp that referenced this issue Apr 24, 2020
GerHobbelt pushed a commit to GerHobbelt/CefSharp that referenced this issue Apr 24, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant