winform引用了CefSharp使用ClickOnce发布后无法打开
问题如题
解决方案:
在项目文件中添加如下代码,其中版本号视具体情况而定。
1 <ItemGroup> 2 <Content Include="$(SolutionDir)packages\cef.redist.x86.3.2623.1401\CEF\**\*" Exclude="$(SolutionDir)packages\cef.redist.x86.3.2623.1401\CEF\x86\**\*;$(SolutionDir)packages\cef.redist.x86.3.2623.1401\CEF\locales\**\*.pak"> 3 <Link>%(RecursiveDir)%(Filename)%(Extension)</Link> 4 <Visible>false</Visible> 5 </Content> 6 </ItemGroup> 7 <ItemGroup> 8 <Content Include="$(SolutionDir)packages\cef.redist.x86.3.2623.1401\CEF\**\en-GB.*;$(SolutionDir)packages\cef.redist.x86.3.2623.1401\CEF\**\en-US.*"> 9 <Link>%(RecursiveDir)%(Filename)%(Extension)</Link> 10 <Visible>false</Visible> 11 </Content> 12 </ItemGroup> 13 <ItemGroup> 14 <Content Include="$(SolutionDir)packages\cef.redist.x86.3.2623.1401\CEF\x86\**\*"> 15 <Link>%(RecursiveDir)%(Filename)%(Extension)</Link> 16 <Visible>false</Visible> 17 </Content> 18 </ItemGroup> 19 <ItemGroup> 20 <Content Include="$(SolutionDir)packages\CefSharp.Common.49.0.1\CefSharp\x86\**\CefSharp.BrowserSubprocess.*"> 21 <Link>%(RecursiveDir)%(Filename)%(Extension)</Link> 22 <Visible>false</Visible> 23 </Content> 24 </ItemGroup>