title: .NET object that is being called by Coldfusion cfobject always thows exception
body: <p>I have a C#.NET application with several Projects (Dlls) and classes.  I have a requirement for coldfusion to call a method within a .NET assembly (compiled code).  This assembly contains a method that is being called by CF.  The method takes in about 4 string variables.  The method instantiates classes from other assemblies (also part of the .Net solution) and performs several database operations.  </p>
  
  <p>I've ran the .NET code that is part of the project within Visual Studio by calling it early within the Page_Load() and passing in the variables that are being passed from CF and it works flawlessly.  However, when I execute it from coldfusion it Crashes with a "Object Reference not set to an instance of an Object".  I'm able to pull these values simply based on putting try,catch blocks on my code.  </p>
  
  <p>I've tried adding additional assemblies since the project has them.  I suspect that maybe no database calls can be made.  I also notice I can't access values within the web.config of .NET using the configuration manager. </p>
  
  <pre><code>'''cf
  &lt;cfset dll1 = expandPath('../../loc/loc/some.dll')&gt;
  &lt;cfset dll2 = expandPath('../../loc/loc/some2.dll')&gt;
  &lt;cfset dll3 = expandPath('../../loc/loc/some3.dll')&gt;
  
  &lt;cfobject type=".NET" name="Doit" class="Namespace.PartialClass" assembly="#dll1#,#dll2#,#dll3#,#dll4#,#dll5#"&gt;
  
  &lt;cfset Doit.init()&gt;     
  
  &lt;!---Doing this so I can see what's available to me---&gt;
  &lt;cfdump var="#Doit#"&gt;
  
  &lt;cfset s = Doit.AMethodinNET(varstring1, varstring2, varstring3, ToString(someint))&gt;
  
  &lt;cfoutput&gt;#s#&lt;/cfoutput&gt;
  '''
  </code></pre>
  
  <p>//Below is the .net code.  It fails around the 2nd Someclass instantiation.</p>
  
  <pre><code>'''.NET
  public string Doit(string somevar1, string somevar2, string somevar3, int somevar4)
  
          {           
              try
  
              { 
  
                  SomeClass.Hey.Someclass classname1 = new SomeClass.Hey.Someclass();
  
                  SomeClass.Hey.Someclassprop prop = classname1.CreateNewUserObject(getPermission(Convert.ToInt32(somevar3)), Convert.ToInt32(somevar4));
  
  
                  prop.somevar1 = somevar1;
                  prop.fName = "Water";
                  prop.lName = "dog";
                  prop.email = somevar4;
                  prop.phone = somevar3;
                  prop.rawPassword = somevar2;
                  prop.companyId = Convert.ToInt32(somevar4);
                  prop.pos = "typer";
                  prop.role = "admin"; 
  
                  SomeClass.AddUpdateUser(Convert.ToInt32(somevar3), prop);
  
              }
  
  
              catch (Exception e)
              {
                  return e.ToString();
              } 
  
              return null;
  
          }
  '''
  </code></pre>