Update
I've created a Patreon
page at https://www.patreon.com/amaitland
All details are outlined there, work is underway!
--
<Project> | |
<!-- | |
Update AppHostPackVersion for .net core 3.1 | |
https://docs.microsoft.com/en-gb/dotnet/core/tools/sdk-errors/netsdk1145 | |
https://developercommunity.visualstudio.com/t/netsdk1145-the-apphost-pack-is-not-installed-error/1513220 | |
--> | |
<ItemGroup> | |
<KnownAppHostPack Update="@(KnownAppHostPack)"> | |
<AppHostPackVersion Condition="'%(TargetFramework)' == 'netcoreapp3.1'">3.1.26</AppHostPackVersion> | |
</KnownAppHostPack> |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
https://go.microsoft.com/fwlink/?LinkID=208121. | |
--> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<Configuration>Release</Configuration> | |
<Platform>x64</Platform> | |
<PublishDir>bin.netcore\Release\netcoreapp3.1\publish\</PublishDir> | |
<PublishProtocol>FileSystem</PublishProtocol> |
var resourceStream = executingAssembly.GetManifestResourceStream(resourcePath); | |
var memoryStream = new MemoryStream(); | |
resourceStream.CopyTo(memoryStream); | |
resourceStream.Close(); | |
memoryStream.Position = 0; | |
//Add the Access-Control-Allow-Origin header | |
var resourceHandler = ResourceHandler.FromStream(memoryStream); | |
resourceHandler.Headers.Add("Access-Control-Allow-Origin", "*"); |
using System.Reflection; | |
using System.Windows; | |
namespace CefSharp.MinimalExample.Wpf | |
{ | |
public partial class MainWindow : Window | |
{ | |
private bool _firstTime = true; | |
public MainWindow() |
<!-- | |
https://github.com/dotnet/sdk/issues/1518#issuecomment-324638682 | |
--> | |
<Project> | |
<PropertyGroup> | |
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath> | |
</PropertyGroup> | |
</Project> |
<application xmlns="urn:schemas-microsoft-com:asm.v3"> | |
<windowsSettings> | |
<!-- Per Monitor V1 [OS >= Windows 8.1] | |
Values: False, True, Per-monitor, True/PM --> | |
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> | |
true/PM</dpiAware> | |
<!-- Per Monitor V1 [OS >= Windows 10 Anniversary Update (1607, 10.0.14393, Redstone 1)] | |
Values: Unaware, System, PerMonitor --> | |
<!-- Per Monitor V2 [OS >= Windows 10 Creators Update (1703, 10.0.15063, Redstone 2)] | |
Value: PerMonitorV2 --> |
using CefSharp.Wpf; | |
using System; | |
namespace CefSharp.MinimalExample.Wpf | |
{ | |
/// <summary> | |
/// ChromiumWebBrowser that loads before being attached to the visual tree | |
/// </summary> | |
/// <example> | |
/// <code> |
using System; | |
using System.IO; | |
using System.Net; | |
namespace CefSharp.MinimalExample.WinForms | |
{ | |
//This class would only be used if you choose Option #2 | |
public class CustomFolderSchemeHandlerFactory : ISchemeHandlerFactory | |
{ | |
private readonly string rootFolder; |
// Copyright © 2019 The CefSharp Authors. All rights reserved. | |
// | |
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | |
using System; | |
using System.IO; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using CefSharp.Enums; |
Update
I've created a Patreon
page at https://www.patreon.com/amaitland
All details are outlined there, work is underway!
--