deploy Winform-application: Could not load file or assembly 'CefSharp.Core.Runtime.dll #3402
Replies: 2 comments 14 replies
-
What exactly did you add and Where did you add it? Are you targeting x86 or x64 or AnyCpu? |
Beta Was this translation helpful? Give feedback.
-
I am sorry but just adding this to a PropertyGroup in Visual Studio 2017 did not seem to work: Adding this to the project file solved the problem in which duplicates are removed from the manifest file:
Or adding this to the project file helped as well:
It seems v87.1.1.132 still needs some things to be added to the project file in a ClickOnce Visual Studio 2017-project. Thanks for responding to my discussion. Best Regards, |
Beta Was this translation helpful? Give feedback.
-
Dear Team,
I want to deploy a C# Winform-application with CEFSharp. After publishing, a setup.exe is created but I got this error on clicking the setup.exe: Could not load file or assembly 'CefSharp.Core.Runtime.dll'.
The program runs without problems in Visual Studio 2017 in the development-debug mode. Both 'CefSharp.Core.Runtime.dll' and 'CefSharp.Core.dll' are found in the deployment package.
I already read the other discussions and i tried accordingly but I still got the error.
Please assist. Thanks,
Depending on the Platform Target architecture (x64, x86) and the build (debug , release) I added this property to the project file:
<CefSharpBuildAction>Content</CefSharpBuildAction>
For example I added this for a Debug x64 build platform:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<CefSharpBuildAction>Content</CefSharpBuildAction>
the property is not supported by AnyCPU at the time of this writing.
The error does not seem to appear in Visual Studio 2019.
Solved by adding this to the project file in Visual Studio 2017:
Adding this solved the problem in which duplicates are removed from the manifest file:
<Target Name="CefSharpClickOnceVS2017" BeforeTargets="GenerateApplicationManifest">
<ItemGroup>
<_DeploymentManifestFiles Remove="$(SolutionDir)packages\CefSharp.Common.87.1.132\buildTransitive\..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.dll" />
<_DeploymentManifestFiles Remove="$(SolutionDir)packages\CefSharp.Common.87.1.132\buildTransitive\..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.pdb" />
<_DeploymentManifestFiles Remove="$(SolutionDir)packages\CefSharp.Common.87.1.132\buildTransitive\..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.xml" />
</ItemGroup>
</Target>
Or adding this to the project file helped as well:
<ItemGroup>
<Content Include="$(SolutionDir)packages\cef.redist.x64.87.1.13\CEF\**\*" Exclude="$(SolutionDir)packages\cef.redist.x64.87.1.13\CEF\x64\**\*;$(SolutionDir)packages\cef.redist.x64.87.1.13\CEF\locales\**\*.pak">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
<Content Include="$(SolutionDir)packages\cef.redist.x64.87.1.13\CEF\**\en-US.*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
</Content>
<Content Include="$(SolutionDir)packages\cef.redist.x64.87.1.13\CEF\x64\**\*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
<Content Include="$(SolutionDir)packages\CefSharp.Common.87.1.132\CefSharp\x64\**\CefSharp.BrowserSubprocess.*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
What is used:
NuGet-packages installed:
What I want to deploy:
Result:
************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'CefSharp.Core.Runtime.dll' or one of its dependencies. The specified module could not be found.
File name: 'CefSharp.Core.Runtime.dll'
at CefSharp.CefSettingsBase..ctor()
at CefSharp.OffScreen.CefSettings..ctor()
at CEFSimplified.Form1.Form1_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
.dll-files involved, all found on the computer in question:
KERNEL32.dll
MSVCP140.dll
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
libcef.dll
USER32.dll
mscoree.dll
Microsoft Visual C++ 2005,2008, 2010, 2012,2013, 2015-2019 installed
Beta Was this translation helpful? Give feedback.
All reactions