<?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: External Commands won't execute in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3322287#M81041</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revit loads the dll on demand, so only when the user actually executes the command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order to use VSTA Revit needs to switch to using .NET Framework 2.0 and I guess maybe that's why your AddIn is not working properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could either modify the Revit.exe.config so that Revit will use .NET Framework 4.0 or simply call "C:\Program Files\Autodesk\Revit Architecture 2012\Program\RevitVSTAConfig.exe" and select "Restore Revit from VSTA"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Adam Nagy&lt;/P&gt;
&lt;P&gt;Autodesk Developer Network&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2012 02:11:13 GMT</pubDate>
    <dc:creator>adam.nagy</dc:creator>
    <dc:date>2012-02-08T02:11:13Z</dc:date>
    <item>
      <title>External Commands won't execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3313045#M81040</link>
      <description>&lt;P&gt;I'm having a problem getting revit 2012 to execute my external command.&amp;nbsp; I did the simple "My First Pluggin" tutorial, and everything worked.&amp;nbsp; I then switched to VSTA and worked out all my code.&amp;nbsp; I then went back to VS2010 and updated the tutorial file with my new code.&amp;nbsp; Everything compiled just fine, but when i run the external command in revit nohing happens.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I went back and recreated the "My First Pluggin" tutorial from scratch, and it won't execute either.&amp;nbsp; I checked everything repeatedly, but no external commands will work now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I edited the .addin file, and confirmed that it is loading the correct dll.&amp;nbsp; If i delete the dll, it throws an error on statup indicating that the .addin is pointing to the correct file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also found that i can delete the .dll file after revit starts, and then run the command without an error being thrown.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm at a complete loss as to whats going on.&amp;nbsp; I don't get an error message, just no code execution.&amp;nbsp; The fact that i can delete the dll after revit boots, and still don't get an error message when i run the application tells me that it's not even loading the dll.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2012 22:07:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3313045#M81040</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-31T22:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: External Commands won't execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3322287#M81041</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revit loads the dll on demand, so only when the user actually executes the command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order to use VSTA Revit needs to switch to using .NET Framework 2.0 and I guess maybe that's why your AddIn is not working properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could either modify the Revit.exe.config so that Revit will use .NET Framework 4.0 or simply call "C:\Program Files\Autodesk\Revit Architecture 2012\Program\RevitVSTAConfig.exe" and select "Restore Revit from VSTA"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Adam Nagy&lt;/P&gt;
&lt;P&gt;Autodesk Developer Network&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2012 02:11:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3322287#M81041</guid>
      <dc:creator>adam.nagy</dc:creator>
      <dc:date>2012-02-08T02:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: External Commands won't execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3322789#M81042</link>
      <description>&lt;P&gt;I actually managed to get it to work by downloading the source for the tutorial and using it.&amp;nbsp; I've gone over this repeatedly, and i can't find the difference between the 2.&amp;nbsp;&amp;nbsp; However, i have 2 issues with your reply:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Correct me if i'm wrong, but wouln't this then preclude a user from using both?&amp;nbsp; What if a user purchases an addon dll, but also wants to use VSTA for some of their own small macros?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Since it worked when i used the source code, this doesn't seem to be the issue anyhow. I recreated the demo repeatedly, and each time it failed (save for the first time).&amp;nbsp; Obviously, it would seem that i was making a mistake, but i've been a programmer for more than 20 years, and this is isn't exactly new to me.&amp;nbsp; The code compiled fine, my tests clearly indicated that the .addin file was correct, and was pointing to the correct dll.&amp;nbsp; Also the complete absense of an error message makes me doubt it was a .NET error.&amp;nbsp; I think it would have thrown an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since i'm up and running right now, it doesn't much matter to me what the problem was, but i suspect more people will run into this problem in the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2012 13:24:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3322789#M81042</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-08T13:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: External Commands won't execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3322911#M81043</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Yes, that is exactly what happens if your AddIn is set to use .NET 4.0&lt;/P&gt;
&lt;P&gt;If Revit is set to use .NET 2.0 (so that VSTA will work) then your .NET 4.0 AddIn will not load&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) I guess that your new project is using .NET 2.0, 3.0 or 3.5 which are all compatible,&amp;nbsp;and no matter which framework version Revit is loading (depending on the settings in Revit.exe.config) your AddIn will work&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this explains.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Adam&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2012 14:20:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3322911#M81043</guid>
      <dc:creator>adam.nagy</dc:creator>
      <dc:date>2012-02-08T14:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: External Commands won't execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3323075#M81044</link>
      <description>&lt;P&gt;Yes, you are correct.&amp;nbsp; The problem however is that the tutorial clearly states that if you are targeting Revit2012, you should use .NET4.0.&amp;nbsp; This explains why no matter how many times i tried to recreate the project it always failed.&amp;nbsp; I was simply following the tutorial as written.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can update the tutorial so that no one else has to waste a few days trying to figure this out again...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2012 15:27:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3323075#M81044</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-08T15:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: External Commands won't execute</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3323535#M81045</link>
      <description>&lt;P&gt;Good point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll ask my colleagues to get the tutorial updated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2012 17:52:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/external-commands-won-t-execute/m-p/3323535#M81045</guid>
      <dc:creator>adam.nagy</dc:creator>
      <dc:date>2012-02-08T17:52:55Z</dc:date>
    </item>
  </channel>
</rss>

