<?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: WPF Controls In PaletteSet in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311534#M73932</link>
    <description>Try using DocumentManager.ExecuteInApplicationContext&lt;BR /&gt;
to run your Initialize() method in the application context.&lt;BR /&gt;
&lt;BR /&gt;
You would use something like this:&lt;BR /&gt;
&lt;BR /&gt;
using Acad = Autodesk.AutoCAD.ApplicationServices.Application;&lt;BR /&gt;
&lt;BR /&gt;
public class MyApplication : IExtensionApplication&lt;BR /&gt;
{&lt;BR /&gt;
    public void Initialize()&lt;BR /&gt;
    {&lt;BR /&gt;
         Acad.DocumentManager.ExecuteInApplicationContext(&lt;BR /&gt;
            delegate( object unused )&lt;BR /&gt;
            {&lt;BR /&gt;
&lt;BR /&gt;
                // TODO: call the method that creates your paletteset&lt;BR /&gt;
&lt;BR /&gt;
            }, null&lt;BR /&gt;
         );&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;BR /&gt;
    public void Terminate{}&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
&lt;DOUSMELL&gt; wrote in message news:5995812@discussion.autodesk.com...&lt;BR /&gt;
Tony,&lt;BR /&gt;
&lt;BR /&gt;
It looks like IsApplicationContext=false. I've posted a simplified version of my solution if you would like to have a closer look. I am using ACA2008 SP1. Like I said, all runs well while debugging. &lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help, I can't even count the number of times your posts have saved my a@#.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again,&lt;/DOUSMELL&gt;</description>
    <pubDate>Fri, 01 Aug 2008 02:24:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-08-01T02:24:43Z</dc:date>
    <item>
      <title>WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311530#M73928</link>
      <description>I'm having some issues w/ VS2008 and AutoCAD:&lt;BR /&gt;
•	When I run code using VS2008 in debug works flawlessly.&lt;BR /&gt;
•	When NETLOAD module independently of VS2008 =&amp;gt; Crash and burn. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
Can someone please help?&lt;BR /&gt;
internal class paletteSetLibrary&lt;BR /&gt;
    {&lt;BR /&gt;
        // {31258470-74A3-4b73-AF2F-EB5342684526}&lt;BR /&gt;
        private static Guid PaletteSetId = new Guid("31258470-74A3-4b73-AF2F-EB5342684526");&lt;BR /&gt;
&lt;BR /&gt;
        public PaletteSet paletteSet { get; set; }&lt;BR /&gt;
        public void Initialize()&lt;BR /&gt;
        {&lt;BR /&gt;
            paletteSet = new PaletteSet("Library", PaletteSetId)&lt;BR /&gt;
                             {&lt;BR /&gt;
                                 Visible = true,&lt;BR /&gt;
                                 Style = PaletteSetStyles.Snappable | PaletteSetStyles.ShowAutoHideButton,&lt;BR /&gt;
                                 WindowState = FormWindowState.Normal,&lt;BR /&gt;
                                 KeepFocus = true&lt;BR /&gt;
                             };&lt;BR /&gt;
            var libraryViewer = new LibraryViewer();&lt;BR /&gt;
            &lt;BR /&gt;
            var elementHost = new ElementHost(){Dock = DockStyle.Fill};&lt;BR /&gt;
            elementHost.Child = libraryViewer;&lt;BR /&gt;
            &lt;BR /&gt;
            paletteSet.Add("Details", elementHost);&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
    }</description>
      <pubDate>Wed, 30 Jul 2008 22:04:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311530#M73928</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-30T22:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311531#M73929</link>
      <description>I've run into a similar problem, which I'm not sure can be fixed.  (Don't take my word for it though).&lt;BR /&gt;
&lt;BR /&gt;
The reasoning is that WPF doesn't allow you to update it with a thread other than the one that it was created with.  I had better success using a form to host my controls, but I'd still get crashes.&lt;BR /&gt;
&lt;BR /&gt;
If you find a way to get past it, I'd be very excited to hear!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 31 Jul 2008 19:36:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311531#M73929</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-31T19:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311532#M73930</link>
      <description>From your Initialize() method, check the value of the DocumentManager's IsApplicationContext property and &lt;BR /&gt;
tell us what it returns.&lt;BR /&gt;
&lt;BR /&gt;
Also what release of AutoCAD is this?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
&lt;DOUSMELL&gt; wrote in message news:5994737@discussion.autodesk.com...&lt;BR /&gt;
I'm having some issues w/ VS2008 and AutoCAD:&lt;BR /&gt;
• When I run code using VS2008 in debug works flawlessly.&lt;BR /&gt;
• When NETLOAD module independently of VS2008 =&amp;gt; Crash and burn. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
Can someone please help?&lt;BR /&gt;
internal class paletteSetLibrary&lt;BR /&gt;
    {&lt;BR /&gt;
        // {31258470-74A3-4b73-AF2F-EB5342684526}&lt;BR /&gt;
        private static Guid PaletteSetId = new Guid("31258470-74A3-4b73-AF2F-EB5342684526");&lt;BR /&gt;
&lt;BR /&gt;
        public PaletteSet paletteSet { get; set; }&lt;BR /&gt;
        public void Initialize()&lt;BR /&gt;
        {&lt;BR /&gt;
            paletteSet = new PaletteSet("Library", PaletteSetId)&lt;BR /&gt;
                             {&lt;BR /&gt;
                                 Visible = true,&lt;BR /&gt;
                                 Style = PaletteSetStyles.Snappable | PaletteSetStyles.ShowAutoHideButton,&lt;BR /&gt;
                                 WindowState = FormWindowState.Normal,&lt;BR /&gt;
                                 KeepFocus = true&lt;BR /&gt;
                             };&lt;BR /&gt;
            var libraryViewer = new LibraryViewer();&lt;BR /&gt;
            &lt;BR /&gt;
            var elementHost = new ElementHost(){Dock = DockStyle.Fill};&lt;BR /&gt;
            elementHost.Child = libraryViewer;&lt;BR /&gt;
            &lt;BR /&gt;
            paletteSet.Add("Details", elementHost);&lt;BR /&gt;
        }&lt;BR /&gt;
&lt;BR /&gt;
    }&lt;/DOUSMELL&gt;</description>
      <pubDate>Thu, 31 Jul 2008 19:56:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311532#M73930</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-31T19:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311533#M73931</link>
      <description>Tony,&lt;BR /&gt;
&lt;BR /&gt;
It looks like IsApplicationContext=false. I've posted a simplified version of my solution if you would like to have a closer look. I am using ACA2008 SP1. Like I said, all runs well while debugging. &lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help, I can't even count the number of times your posts have saved my a@#.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again,</description>
      <pubDate>Thu, 31 Jul 2008 20:06:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311533#M73931</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-31T20:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311534#M73932</link>
      <description>Try using DocumentManager.ExecuteInApplicationContext&lt;BR /&gt;
to run your Initialize() method in the application context.&lt;BR /&gt;
&lt;BR /&gt;
You would use something like this:&lt;BR /&gt;
&lt;BR /&gt;
using Acad = Autodesk.AutoCAD.ApplicationServices.Application;&lt;BR /&gt;
&lt;BR /&gt;
public class MyApplication : IExtensionApplication&lt;BR /&gt;
{&lt;BR /&gt;
    public void Initialize()&lt;BR /&gt;
    {&lt;BR /&gt;
         Acad.DocumentManager.ExecuteInApplicationContext(&lt;BR /&gt;
            delegate( object unused )&lt;BR /&gt;
            {&lt;BR /&gt;
&lt;BR /&gt;
                // TODO: call the method that creates your paletteset&lt;BR /&gt;
&lt;BR /&gt;
            }, null&lt;BR /&gt;
         );&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;BR /&gt;
    public void Terminate{}&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
&lt;DOUSMELL&gt; wrote in message news:5995812@discussion.autodesk.com...&lt;BR /&gt;
Tony,&lt;BR /&gt;
&lt;BR /&gt;
It looks like IsApplicationContext=false. I've posted a simplified version of my solution if you would like to have a closer look. I am using ACA2008 SP1. Like I said, all runs well while debugging. &lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help, I can't even count the number of times your posts have saved my a@#.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again,&lt;/DOUSMELL&gt;</description>
      <pubDate>Fri, 01 Aug 2008 02:24:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311534#M73932</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-01T02:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311535#M73933</link>
      <description>Another option, if your paletteSet is created by the &lt;BR /&gt;
handler of a registered command, is to include the&lt;BR /&gt;
CommandFlags.Session flag to the CommandMethod &lt;BR /&gt;
attribute.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message news:5996057@discussion.autodesk.com...&lt;BR /&gt;
Try using DocumentManager.ExecuteInApplicationContext&lt;BR /&gt;
to run your Initialize() method in the application context.&lt;BR /&gt;
&lt;BR /&gt;
You would use something like this:&lt;BR /&gt;
&lt;BR /&gt;
using Acad = Autodesk.AutoCAD.ApplicationServices.Application;&lt;BR /&gt;
&lt;BR /&gt;
public class MyApplication : IExtensionApplication&lt;BR /&gt;
{&lt;BR /&gt;
    public void Initialize()&lt;BR /&gt;
    {&lt;BR /&gt;
         Acad.DocumentManager.ExecuteInApplicationContext(&lt;BR /&gt;
            delegate( object unused )&lt;BR /&gt;
            {&lt;BR /&gt;
&lt;BR /&gt;
                // TODO: call the method that creates your paletteset&lt;BR /&gt;
&lt;BR /&gt;
            }, null&lt;BR /&gt;
         );&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;BR /&gt;
    public void Terminate{}&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
&lt;DOUSMELL&gt; wrote in message news:5995812@discussion.autodesk.com...&lt;BR /&gt;
Tony,&lt;BR /&gt;
&lt;BR /&gt;
It looks like IsApplicationContext=false. I've posted a simplified version of my solution if you would like to have a closer look. I am using ACA2008 SP1. Like I said, all runs well while debugging. &lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help, I can't even count the number of times your posts have saved my a@#.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again,&lt;/DOUSMELL&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Fri, 01 Aug 2008 17:39:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311535#M73933</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-01T17:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311536#M73934</link>
      <description>Tony,&lt;BR /&gt;
&lt;BR /&gt;
I tried both ExecuteInApplicationContextCallback &amp;amp; CommandFlags.Session from a CommandMethod to no avail. I will be plowing ahead until I get it to work. If it works in Debug there has to be a way to get it to work outside of VS2008.</description>
      <pubDate>Fri, 01 Aug 2008 23:27:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311536#M73934</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-01T23:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311537#M73935</link>
      <description>dousmell wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; I'm having some issues w/ VS2008 and AutoCAD:&lt;BR /&gt;
&lt;BR /&gt;
I don't know if it will help, but Autodesk has this free webcast&lt;BR /&gt;
scheduled soon:&lt;BR /&gt;
&lt;BR /&gt;
"AutoCAD: Creating a UI using WPF, Webcast, Aug 26 2008."&lt;BR /&gt;
http://www.adskconsulting.com/adn/cs/api_course_sched.php.&lt;BR /&gt;
&lt;BR /&gt;
Good Luck, Terry</description>
      <pubDate>Tue, 05 Aug 2008 17:22:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311537#M73935</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-05T17:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311538#M73936</link>
      <description>Here are three ways to code WPF that may or may not be of any help depending on what your doing.&lt;BR /&gt;
&lt;BR /&gt;
I used Expression Blend 2.5 June Preview to do the gradient and buttons.</description>
      <pubDate>Fri, 08 Aug 2008 20:51:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311538#M73936</guid>
      <dc:creator>Mikko</dc:creator>
      <dc:date>2008-08-08T20:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311539#M73937</link>
      <description>I get an exception when using the commands &lt;BR /&gt;
&lt;BR /&gt;
System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it.</description>
      <pubDate>Sat, 09 Aug 2008 16:56:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311539#M73937</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-09T16:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311540#M73938</link>
      <description>Others may be able to help if they had a reproducible case,&lt;BR /&gt;
but unfortunately the project you uploaded is not buildable&lt;BR /&gt;
because it references assemblies not included.&lt;BR /&gt;
&lt;BR /&gt;
If you can produce a simple, scaled down case where the&lt;BR /&gt;
error occurs, we may be able to help solve your problem.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
&lt;DOUSMELL&gt; wrote in message news:5997000@discussion.autodesk.com...&lt;BR /&gt;
Tony,&lt;BR /&gt;
&lt;BR /&gt;
I tried both ExecuteInApplicationContextCallback &amp;amp; CommandFlags.Session from a CommandMethod to no avail. I will be plowing ahead until I get it to work. If it works in Debug there has to be a way to get it to work outside of VS2008.&lt;/DOUSMELL&gt;</description>
      <pubDate>Mon, 11 Aug 2008 14:47:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311540#M73938</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-11T14:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311541#M73939</link>
      <description>When ever your window is mode less, then don't forget to lock the acad document you are dealing with.&lt;BR /&gt;
&lt;BR /&gt;
using (DocumentLock docLock = doc.LockDocument())&lt;BR /&gt;
 {&lt;BR /&gt;
      // Your code...&lt;BR /&gt;
 } &lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Oct 2009 12:14:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311541#M73939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-15T12:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311542#M73940</link>
      <description>I know it's been a while since this initial post was created, but I thought I'd post what worked for me since I was experiencing the same issue.&lt;BR /&gt;
&lt;BR /&gt;
I've created my project in VS2008, and I'm using a WPF User Control for my interface. When debugging, everything would work perfectly. If I would launch AutoCad and load the .dll without going through the debugger, I would get the basic JIT exception. After troubleshooting, it appeared that the rendering of the WPF control is what was throwing the exception. I read through this post and tried the suggested ideas. My IsApplicationContext was 'False' both in and out of debug mode. The thing that fixed it for me was the CommandFlags.Session. Once I added this to my method, everything worked perfectly. I don't understand why this would work in debug only, but it saved my day!&lt;BR /&gt;
&lt;BR /&gt;
If you are interested, I've attached my method.</description>
      <pubDate>Mon, 23 Nov 2009 14:30:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311542#M73940</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-11-23T14:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: WPF Controls In PaletteSet</title>
      <link>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311543#M73941</link>
      <description>The reason it works with the session command flag is because the WPF control &lt;BR /&gt;
needs to be created in the session context, rather than in the document &lt;BR /&gt;
context.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;JSPRANG&gt; wrote in message &lt;BR /&gt;
news:6293699@discussion.autodesk.com...&lt;BR /&gt;
I know it's been a while since this initial post was created, but I thought &lt;BR /&gt;
I'd post what worked for me since I was experiencing the same issue.&lt;BR /&gt;
&lt;BR /&gt;
I've created my project in VS2008, and I'm using a WPF User Control for my &lt;BR /&gt;
interface. When debugging, everything would work perfectly. If I would &lt;BR /&gt;
launch AutoCad and load the .dll without going through the debugger, I would &lt;BR /&gt;
get the basic JIT exception. After troubleshooting, it appeared that the &lt;BR /&gt;
rendering of the WPF control is what was throwing the exception. I read &lt;BR /&gt;
through this post and tried the suggested ideas. My IsApplicationContext was &lt;BR /&gt;
'False' both in and out of debug mode. The thing that fixed it for me was &lt;BR /&gt;
the CommandFlags.Session. Once I added this to my method, everything worked &lt;BR /&gt;
perfectly. I don't understand why this would work in debug only, but it &lt;BR /&gt;
saved my day!&lt;BR /&gt;
&lt;BR /&gt;
If you are interested, I've attached my method.&lt;/JSPRANG&gt;</description>
      <pubDate>Mon, 23 Nov 2009 21:06:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wpf-controls-in-paletteset/m-p/2311543#M73941</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-11-23T21:06:15Z</dc:date>
    </item>
  </channel>
</rss>

