<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: AutoCAD 2021 CefSharp in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11389714#M18596</link>
    <description>&lt;P class=""&gt;Hello, I would like to ask whether there is a way to prohibit CAD loading Accef&lt;/P&gt;</description>
    <pubDate>Tue, 30 Aug 2022 07:49:24 GMT</pubDate>
    <dc:creator>981178411</dc:creator>
    <dc:date>2022-08-30T07:49:24Z</dc:date>
    <item>
      <title>AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/9725613#M18588</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are using CefSharp (&lt;A href="https://www.nuget.org/packages/CefSharp.Wpf/" target="_blank"&gt;https://www.nuget.org/packages/CefSharp.Wpf/&lt;/A&gt;) in one of our AutoCAD-Addins. Until AutoCAD 2020 everything works fine, but since AutoCAD 2021 there is a problem ("&lt;SPAN class="pl-s"&gt;Cef::Initialize() failed&lt;/SPAN&gt;.").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suspect it's AutoCAD's move from AcWebBrowser to AcCef, which breaks our addin. AcCef uses CEF version 77, but there is no corresponding version of CefSharp, just 75 or 79.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could I do to make it run again? Or could Autodesk switch to a version supported by CefSharp?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Achim&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 15:53:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/9725613#M18588</guid>
      <dc:creator>astuy</dc:creator>
      <dc:date>2020-09-02T15:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/9758481#M18589</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;We have the same problem here, any workaround found?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 07:44:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/9758481#M18589</guid>
      <dc:creator>guillaume_aronica</dc:creator>
      <dc:date>2020-09-21T07:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/9758522#M18590</link>
      <description>&lt;P&gt;We solved the problem by switching to the WebView-Control. It's Edge-Engine instead of Chromium, but still better than Trident (Internet Explorer) engine of the old Browser Control.&lt;/P&gt;&lt;P&gt;Until now it works. And if it will not work in future, we will search for any other solution.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 08:10:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/9758522#M18590</guid>
      <dc:creator>astuy</dc:creator>
      <dc:date>2020-09-21T08:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/9760837#M18591</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have nearly the same problem, but&amp;nbsp;I don't think that the problem is the change from AcWebBrowser to AcCef. I think that the problem are some new UI components like the modal window (Autodesk.AutoCAD.ApplicationServices.Application.ShowModalWindow) or the visual browser of the PaletteSet (Autodesk.AutoCAD.Windows.PaletteSet.AddVisualBrowser).&lt;/P&gt;&lt;P&gt;The biggest problem is to find a different solution to allow a communication between some JS-functions from the website and the remaining parts of AutoCAD.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 12:55:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/9760837#M18591</guid>
      <dc:creator>metzdorf</dc:creator>
      <dc:date>2023-02-21T12:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/10027672#M18592</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am facing same issue and getting error {"Cef::Initialize() failed"} with AutoCAD 2021. For all other versions of AUtoCAD it works fine.&lt;/P&gt;&lt;P&gt;Please look into this issue as soon as possible its blocker for our addin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Moulla PAKALI&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 05:26:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/10027672#M18592</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-25T05:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/10294300#M18593</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6144686"&gt;@guillaume_aronica&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4366355"&gt;@metzdorf&lt;/a&gt;&amp;nbsp;@Anonymous :&lt;/P&gt;
&lt;P&gt;We ran into this issue when porting from AutoCAD 2020 to AutoCAD 2022.&lt;/P&gt;
&lt;P&gt;Has someone found a solution in the meantime?&lt;BR /&gt;Switching to WebView as suggested by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2367599"&gt;@astuy&lt;/a&gt;&amp;nbsp; is no option for us.&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 09:12:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/10294300#M18593</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2021-05-06T09:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/10294308#M18594</link>
      <description>&lt;P&gt;Yes I found a solution. I changed my cefsharp implementation to use WebView2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It uses the engine from from the chromium based Edge.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 09:17:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/10294308#M18594</guid>
      <dc:creator>metzdorf</dc:creator>
      <dc:date>2021-05-06T09:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/10686727#M18595</link>
      <description>&lt;P&gt;You can use your own assemblies instead of getting stuck with the ones that ship with AutoCAD.&amp;nbsp; See&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/38671641/could-not-load-file-or-assembly-newtonsoft-json-version-9-0-0-0-culture-neutr/48043024" target="_blank"&gt;https://stackoverflow.com/questions/38671641/could-not-load-file-or-assembly-newtonsoft-json-version-9-0-0-0-culture-neutr/48043024&lt;/A&gt;&amp;nbsp;- put it in the startup method. Relevant codez&amp;nbsp;that I use&amp;nbsp; for something similar in case dead link ...&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;/// &amp;lt;summary&amp;gt; Initializes thisCadtool in AutoCAD / BricsCAD. Runs when Tool is loaded&amp;lt;/summary&amp;gt;
/// &amp;lt;seealso cref="AcRun.IExtensionApplication.Initialize()"/&amp;gt;
public void Initialize() // &amp;lt;= Sometimes the Intialize() fires more than once  http://www.theswamp.org/index.php?topic=13630.msg194036#msg194036
{
    try
    {
        AppDomain currentDomain = AppDomain.CurrentDomain;                               // wait for the app to be ready: https://www.keanw.com/2013/01/displaying-a-dialog-on-autocad-startup-using-net.html
        currentDomain.AssemblyResolve -= new ResolveEventHandler(MyResolveEventHandler); // &amp;lt;= Sometimes the Intialize() fires more than once
        currentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler); // https://forums.autodesk.com/t5/navisworks-api/could-not-load-file-or-assembly-newtonsoft-json/td-p/7028055?profile.language=en
        
         // ... more stuffs
     }
     catch (Exception ex)
     {
        App.Log.Error(ex, "Initialize() blew up");
     }
     
     /// &amp;lt;summary&amp;gt; Because AutoCAD hijacks the version of &amp;lt;c&amp;gt;JSON.NET&amp;lt;/c&amp;gt; if you don't tell it to xxxx off&amp;lt;/summary&amp;gt;
}    /// &amp;lt;remarks&amp;gt; https://forums.autodesk.com/t5/navisworks-api/could-not-load-file-or-assembly-newtonsoft-json/m-p/7460535#M3467 &amp;lt;/remarks&amp;gt;&amp;gt; 
     /// &amp;lt;param name="sender"&amp;gt; Source of the event. &amp;lt;/param&amp;gt;
     /// &amp;lt;param name="args"&amp;gt;   Resolve event information. &amp;lt;/param&amp;gt;
     /// &amp;lt;returns&amp;gt; &amp;lt;c&amp;gt;JSON.NET&amp;lt;/c&amp;gt; &amp;lt;/returns&amp;gt;
private Assembly MyResolveEventHandler(object sender, ResolveEventArgs args)
{
    if (args?.Name?.Contains("Newtonsoft.Json") ?? false)
    {
        try
        {
            string assemblyFileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Newtonsoft.Json.dll";
            return Assembly.LoadFrom(assemblyFileName);
        }
        catch (Exception e)
        {
            App.Log.Error(e, "FAILed loading JSON.NET"); // will probably fail because logger uses JSON.NET
            return null;
        }
    }
    else
        return null;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 21:16:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/10686727#M18595</guid>
      <dc:creator>CADbloke</dc:creator>
      <dc:date>2021-10-13T21:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11389714#M18596</link>
      <description>&lt;P class=""&gt;Hello, I would like to ask whether there is a way to prohibit CAD loading Accef&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 07:49:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11389714#M18596</guid>
      <dc:creator>981178411</dc:creator>
      <dc:date>2022-08-30T07:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11769772#M18597</link>
      <description>&lt;P&gt;Is there any update on the conflict between the Cefsharp and the AcCef?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 12:45:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11769772#M18597</guid>
      <dc:creator>hamgeorge2015</dc:creator>
      <dc:date>2023-02-21T12:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11769818#M18598</link>
      <description>&lt;P&gt;I have not followed this problem any more since I changed to WebView2.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 12:59:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11769818#M18598</guid>
      <dc:creator>metzdorf</dc:creator>
      <dc:date>2023-02-21T12:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11815040#M18599</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4366355"&gt;@metzdorf&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello, how to proceed to use webview2?&lt;BR /&gt;I downloaded the SDK using NuGet. When it is an EXE application, it works perfectly and the site is shown in the webview, but when it is a DLL application for autocad, nothing is shown. The form only has the webview.&lt;/P&gt;&lt;P&gt;I'm using version 2023.&lt;BR /&gt;One image shows how the form is in visual studio, another shows when it is an EXE application (showing google) and another shows when it is a DLL in autocad (empty form).&lt;/P&gt;&lt;P&gt;What should I do?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 20:00:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11815040#M18599</guid>
      <dc:creator>ceduca</dc:creator>
      <dc:date>2023-03-11T20:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11816850#M18600</link>
      <description>&lt;P&gt;Hi ceduca,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe you could have one of my initial problems:&lt;/P&gt;&lt;P&gt;- are all required dll's in the directory with you build dll? (Microsoft.Web.WebView2.Core.dll,&amp;nbsp;Microsoft.Web.WebView2.WinForms.dll and&amp;nbsp;WebView2Loader.dll)&lt;/P&gt;&lt;P&gt;- do you run the complete init in you dll in the right order? (CoreWebView2Environment.CreateAsync, WebView2.EnsureCoreWebView2Async)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A different problem could be the ResizeHandling. In my application was a problem the resize handling. After changing the panel size, was the browser empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps a little bit.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 06:11:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11816850#M18600</guid>
      <dc:creator>metzdorf</dc:creator>
      <dc:date>2023-03-13T06:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD 2021 CefSharp</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11817900#M18601</link>
      <description>Hi metzdorf!&lt;BR /&gt;&lt;BR /&gt;Thanks for answering.&lt;BR /&gt;&lt;BR /&gt;When used in an EXE, WebView2Loader.dll does not need to be in the same folder as the EXE, but when used in a DLL it does. I also changed the init order of CoreWebView2Environment.CreateAsync, WebView2.EnsureCoreWebView2Async.&lt;BR /&gt;&lt;BR /&gt;Now it's working&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Mon, 13 Mar 2023 14:21:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-2021-cefsharp/m-p/11817900#M18601</guid>
      <dc:creator>ceduca</dc:creator>
      <dc:date>2023-03-13T14:21:39Z</dc:date>
    </item>
  </channel>
</rss>

