<?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: Odd .net plugin behaviour in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/odd-net-plugin-behaviour/m-p/8131506#M9492</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For your questions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;1. Are my assumptions about loading the assembly correct?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is quite dangerous in my opinion. Maya .net sdk is a wrapper for C++ API, if C++ APIs's prototypes are changed it is fairly dangerous to use an old version of .net SDK in a newer version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;2. How do I enable maya to spew what's actually the problem when it won't load the assembly. I'm assuming that it's missing a dll of some sort, but all essential dll's have been provide.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am afraid you can't. Sorry for the bad news.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your description, it could be CAS policy. I remember I downloaded a sample from a client several years ago,&amp;nbsp; it violated .NET's CAS policy on my computer. When an app tries to load an assembly from remote location, sometimes it will block that assembly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try to create a maya.exe.config with &lt;A href="https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/loadfromremotesources-element" target="_blank"&gt;loadFromRemoteSources &lt;/A&gt;inside maya/bin to check if it was the issue.&lt;/P&gt;
&lt;PRE&gt;&amp;lt;configuration&amp;gt;  
   &amp;lt;runtime&amp;gt;  
      &amp;lt;loadFromRemoteSources enabled="true"/&amp;gt;  
   &amp;lt;/runtime&amp;gt;  
&amp;lt;/configuration&amp;gt;  &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;If a dll is missing, you could try dependency walker(for native) and ILSpy(for .net). Hope it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jul 2018 02:09:23 GMT</pubDate>
    <dc:creator>cheng_xi_li</dc:creator>
    <dc:date>2018-07-16T02:09:23Z</dc:date>
    <item>
      <title>Odd .net plugin behaviour</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/odd-net-plugin-behaviour/m-p/8129246#M9491</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We've created a .net (C#) plugin linked against the 2016 version of the Maya SDK (openmayacs.dll).&lt;/P&gt;&lt;P&gt;We've experienced the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;on some machines with Maya 2016, 2017 and 2018, the plugin with load AND RUN on all versions of Maya.&lt;/LI&gt;&lt;LI&gt;on other machines, the plugin will not load on the appropriate version of Maya, with the following error:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;// Error: file: C:/AW/Maya2016/scripts/others/pluginWin.mel line 781: Invoking ExecuteInDefaultAppDomain() failed. //&lt;BR /&gt;# Error: pymel : Failed to get controlCommand list from ProjectA.PluginA #&lt;BR /&gt;# Error: pymel : Failed to get modelEditorCommand list from &lt;SPAN&gt;ProjectA&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;PluginA&lt;/SPAN&gt; #&lt;BR /&gt;# Error: pymel : Failed to get command list from &lt;SPAN&gt;ProjectA&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;PluginA&lt;/SPAN&gt; #&lt;BR /&gt;# Error: pymel : Failed to get constraintCommand list from &lt;SPAN&gt;ProjectA&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;PluginA&lt;/SPAN&gt; #&lt;BR /&gt;# Error: pymel.core : Failed to get depend nodes list from &lt;SPAN&gt;ProjectA&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;PluginA&lt;/SPAN&gt; #&lt;BR /&gt;// Error: file: C:/AW/Maya2016/scripts/others/pluginWin.mel line 781: (&lt;SPAN&gt;ProjectA&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;PluginA&lt;/SPAN&gt;.nll) //&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition to this, we have also noted that .net plugins linked against newer versions of the MayaSDK will run on older versions of Maya. IE: linking against MayaSDK 2017 (openmayacs.dll) will run on Maya 2016.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My assumptions have been, since we're loading this assembly, it's fairly indifferent as to what version of the SDK you're linked against. But that feels dangerous.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm looking to find out are:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Are my assumptions about loading the assembly correct?&lt;/LI&gt;&lt;LI&gt;How do I enable maya to spew what's actually the problem when it won't load the assembly. I'm assuming that it's missing a dll of some sort, but all essential dll's have been provide.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks for your responses.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 16:25:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/odd-net-plugin-behaviour/m-p/8129246#M9491</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-13T16:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Odd .net plugin behaviour</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/odd-net-plugin-behaviour/m-p/8131506#M9492</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For your questions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;1. Are my assumptions about loading the assembly correct?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is quite dangerous in my opinion. Maya .net sdk is a wrapper for C++ API, if C++ APIs's prototypes are changed it is fairly dangerous to use an old version of .net SDK in a newer version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;2. How do I enable maya to spew what's actually the problem when it won't load the assembly. I'm assuming that it's missing a dll of some sort, but all essential dll's have been provide.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am afraid you can't. Sorry for the bad news.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your description, it could be CAS policy. I remember I downloaded a sample from a client several years ago,&amp;nbsp; it violated .NET's CAS policy on my computer. When an app tries to load an assembly from remote location, sometimes it will block that assembly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try to create a maya.exe.config with &lt;A href="https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/loadfromremotesources-element" target="_blank"&gt;loadFromRemoteSources &lt;/A&gt;inside maya/bin to check if it was the issue.&lt;/P&gt;
&lt;PRE&gt;&amp;lt;configuration&amp;gt;  
   &amp;lt;runtime&amp;gt;  
      &amp;lt;loadFromRemoteSources enabled="true"/&amp;gt;  
   &amp;lt;/runtime&amp;gt;  
&amp;lt;/configuration&amp;gt;  &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;If a dll is missing, you could try dependency walker(for native) and ILSpy(for .net). Hope it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 02:09:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/odd-net-plugin-behaviour/m-p/8131506#M9492</guid>
      <dc:creator>cheng_xi_li</dc:creator>
      <dc:date>2018-07-16T02:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Odd .net plugin behaviour</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/odd-net-plugin-behaviour/m-p/8133378#M9493</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2777035"&gt;@cheng_xi_li&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your questions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1. Are my assumptions about loading the assembly correct?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is quite dangerous in my opinion. Maya .net sdk is a wrapper for C++ API, if C++ APIs's prototypes are changed it is fairly dangerous to use an old version of .net SDK in a newer version.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I should have been clear in my first question - are my assumptions that Maya&amp;nbsp;&lt;EM&gt;&lt;U&gt;can&lt;/U&gt;&amp;nbsp;&lt;/EM&gt;load plugins (.net based) compiled for other SDK versions? I was always under the impression that you&amp;nbsp;&lt;U&gt;could not&lt;/U&gt; do that. Read: I'm trying to confirm that the behaviour I'm seeing isn't some magic fluke.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am afraid you can't. Sorry for the bad news.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From your description, it could be CAS policy. I remember I downloaded a sample from a client several years ago,&amp;nbsp; it violated .NET's CAS policy on my computer. When an app tries to load an assembly from remote location, sometimes it will block that assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could try to create a maya.exe.config with &lt;A href="https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/loadfromremotesources-element" target="_blank"&gt;loadFromRemoteSources &lt;/A&gt;inside maya/bin to check if it was the issue.&lt;/P&gt;&lt;PRE&gt;&amp;lt;configuration&amp;gt;  
   &amp;lt;runtime&amp;gt;  
      &amp;lt;loadFromRemoteSources enabled="true"/&amp;gt;  
   &amp;lt;/runtime&amp;gt;  
&amp;lt;/configuration&amp;gt;  &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;If a dll is missing, you could try dependency walker(for native) and ILSpy(for .net). Hope it helps.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'll give that a try and see - If I could reproduce this behaviour on my machine, that would aid in my debugging of this problem. However, just creating a simple 'Hello world' assembly causes this issue - no links to other external dll's outside of openmaya.cs, which I have also included in the plugin distribution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 17:14:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/odd-net-plugin-behaviour/m-p/8133378#M9493</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-16T17:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Odd .net plugin behaviour</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/odd-net-plugin-behaviour/m-p/8133811#M9494</link>
      <description>&lt;P&gt;Just to update, adding that `maya.exe.config` file totally resolved the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I have to sort out why that's happening on the destination machine(s).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the info, I don't know how long I would have been digging around to sort that out on my own.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 20:28:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/odd-net-plugin-behaviour/m-p/8133811#M9494</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-16T20:28:40Z</dc:date>
    </item>
  </channel>
</rss>

