Closed ghost closed 9 years ago
Packing and deploying via ClickOnce is currently not at an ideal state. There are a couple of hoops you have to jump manually.
Best help we can offer right now is in #392 - specifically https://github.com/cefsharp/CefSharp/issues/392#issuecomment-46672183
thanks @jornh however I'm not sure the issue here is that the files aren't being copied to the publish folder. It seems more that presentationHost.exe/clickonce is complaining that the cefsharp.subprocess.exe is not the same as the reference in the manifest and prevents downloading it into the clickonce cache from the browser. All files seem to be published into the "Application Files" directory.
Having also just tried an offline /cd version too I'm getting the same error...are the cefsharp binaries being copied to the publish folder after the manifest has been created? is this possible?
Many thanks :)
@JonRowley Screw clickonce, use Squirrel.Windows. Going to save you a lot of pain!
CefSharp currently relies on some unmanaged .dll's and other resource files (from the CEF project). I don't see mention of those in your manifest above. It might be due to that we currently don't add them as dependencies, they're just copied over via .targets
property files in the build\
folders of the different nuget packages. With a bit of luck adding them manually to your CefSharp.Wpf.Example
might be what's missing.
We're slowly working on improving all this to get closer to the middle of the road. But we have a wee bit tougher job than the average pure C# project where ClickOnce (mostly) works. Unfortunately ClickOnce and it's magic sits on top of all that, so it will be the last box we can tick.
If you need it to be ClickOnce, and can't follow @peters suggestion which looks interesting (:+1: Peter) I guess you need to experiment a bit. I guess that's why people until now have either given up or resorted to the manual steps that's documented on SO for CefSharp1 at least. Search our Google Group, Issues here on GitHub and SO for a bit of context.
I got a ClickOnce deployment running, here's a diff of what changed in my CefSharp.MinimaiExample.Wpf.csproj
:
--- C:/Users/jornh/AppData/Local/Temp/JYD9Bd_CefSharp.MinimalExample.Wpf.csproj lø okt 4 22:22:43 2014
+++ CefSharp.MinimalExample.Wpf/CefSharp.MinimalExample.Wpf.csproj lø okt 4 22:19:43 2014
@@ -18,6 +18,22 @@
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>6</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <PublishWizardCompleted>true</PublishWizardCompleted>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@@ -58,6 +74,18 @@
<PropertyGroup>
<ApplicationIcon>chromium-256.ico</ApplicationIcon>
</PropertyGroup>
+ <PropertyGroup>
+ <ManifestCertificateThumbprint>7B822D63F1B82B8DE2491364A88EFFDDB455280F</ManifestCertificateThumbprint>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ManifestKeyFile>CefSharp.MinimalExample.Wpf_TemporaryKey.pfx</ManifestKeyFile>
+ </PropertyGroup>
+ <PropertyGroup>
+ <GenerateManifests>true</GenerateManifests>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignManifests>true</SignManifests>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
@@ -118,6 +146,13 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
+ <None Include="CefSharp.MinimalExample.Wpf_TemporaryKey.pfx" />
+ <Content Include="cef.pak">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="locales\en-US.pak">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@@ -131,19 +166,52 @@
<ItemGroup>
<Resource Include="chromium-256.ico" />
</ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include=".NETFramework,Version=v4.0">
+ <Visible>False</Visible>
+ <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 4.5</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="CefSharp.BrowserSubprocess.exe" />
+ <Content Include="d3dcompiler_43.dll" />
+ <Content Include="d3dcompiler_46.dll" />
+ <Content Include="ffmpegsumo.dll" />
+ <Content Include="icudt.dll" />
+ <Content Include="libcef.dll" />
+ <Content Include="libEGL.dll" />
+ <Content Include="libGLESv2.dll" />
+ </ItemGroup>
+ <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
All i did was basically to Add -> Existing Item... and add the resources (from either x64
or x86
bin etc. depending on what you build. I used x64/Release), then set up a simple local CD deploy as you did. The most tricky ones were the two .pak
files. They need a Build Action = Content
property.
I used https://github.com/cefsharp/CefSharp.MinimalExample/pull/10 as my starting point.
@peters wish I could use squirrel! :+1: @jornh thanks for the info I'll have a play and see what I can come up with. Also had a look at the https://github.com/Code52/DownmarkerWPF as they use clickOnce too. Thanks for your help! :)
@JonRowley did you get to a useable ClickOnce?
I can push what I quickly whipped together if it helps...
Hi, sorry for the delay in replying. I moved away from this project and didn't get time to test again so I can't confirm or deny its working, however I've seen a couple of projects with it working and your solution seemed to work so I'd be happy to close this as complete if you are happy with your changes. Thanks
On 22 Oct 2014, at 05:48, jornh notifications@github.com wrote:
@JonRowley did you get to a useable ClickOnce?
I can push what I quickly whipped together if it helps...
— Reply to this email directly or view it on GitHub.
Closing. Reopen if required.
One note about the above, having just gone through this myself: Ensure that CefSharp.BrowserSubprocess.exe is added to the project through project -> Add -> Existing Item with the Build Action = Content as jornh said above, and not by adding it as a reference. If it is added as a reference it will still give the error JonRowley describes above.
If anyone feels like creating a wiki entry
that would be much appreciated. I'm sure others would benefit and we can finally close #392
For reference anyone can add/edit a page on the wiki
if anyone else has this problem, this script was the solution for me https://github.com/Code52/DownmarkerWPF/blob/master/tools/UpdateManifest.ps1
I'm currently trying to build the cefsharp wpf example as a clickonce online only application but keep getting a manifest error. I've checked the version number for the exe and that matches the manifest file (31.0.0.0). I'm now stuck and not sure what else to check?
-I've added a test certificate and signed the manifest with that. -compiled with vs2013
Here's the clickonce deployment error log:
here's a copy of the manifest that is produced: