Skip to content

WinForms - Net 6 PublishSingleFile FileNotFoundException #4150

@Eviav

Description

@Eviav
  • version
    102.0.100

  • What architecture x86 or x64?
    x64

  • What version of .Net?
    .Net 6.0

  • On what operating system?
    Win11

  • Are you using WinForms, WPF or OffScreen?
    WinForms

  • What steps will reproduce the problem?

    • PublishSingleFile projects cannot run on Win11 Home , I can't run even if I copy CefSharp.Core.Runtime.dll CefSharp.Core.dll ... file
    • I used [Program.PublishSingleFile.cs](https://github.com/cefsharp/CefSharp.MinimalExample/blob/master/CefSharp.MinimalExample.WinForms/Program.PublishSingleFile.cs) in net6.0 project
  • Please provide any additional information below.
    Exception Info: System.IO.FileNotFoundException:
    File name: 'CefSharp.Core.Runtime, Version=102.0.100, Culture=neutral, PublicKeyToken=40c4b6fc221f4138'

微信截图_20220630162835

        static int Main(string[] args)
        {
            var exitCode = CefSharp.BrowserSubprocess.SelfHost.Main(args);
            if (exitCode >= 0)
            {
                return exitCode;
            }
                var settings = new CefSharp.WinForms.CefSettings()
                {
                    MultiThreadedMessageLoop = true,
                    IgnoreCertificateErrors = true,
                    CachePath = Program.CachePath,
                    LogSeverity = LogSeverity.Disable,
                    BrowserSubprocessPath = ExePath
                };
                Cef.Initialize(settings, false);
	<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0-windows' AND '$(PublishSingleFile)' == 'true'">
		<!-- Extract all files to disk at runtime -->
		<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
		<!-- Include our native files in the resulting exe -->
		<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
	</PropertyGroup>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions