-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: SukhCSharp
Message 1 in Discussion

 
Hi! 
Unable to load assembly using �Assembly.Load�. It throw error one or more dependencies 
not found.<o:p></o:p> 
This is my code: 
----------Client code(its winform)-------- 
private void button1_Click(object sender, System.EventArgs e) 
{<o:p></o:p> 
int retval;<o:p></o:p> 
      IMyLib.IAccount refIacc;<o:p></o:p> 
      string clsname = "MyPrj.MyLib.Account";<o:p></o:p> 
      try<o:p></o:p> 
      {<o:p></o:p> 
refIacc = 
(MyPrj.IMyLib.IAccount)Assembly.Load("Account").CreateInstance(clsname);<o:p></o:p> 
                  retval = refIacc.setval();<o:p></o:p> 
       }<o:p></o:p> 
       catch (Exception ex)<o:p></o:p> 
       {<o:p></o:p> 
        MessageBox.Show(ex.ToString());<o:p></o:p> 
       }<o:p></o:p> 
      }<o:p></o:p> 
------------------Library Code-----------<o:p></o:p> 
using System;<o:p></o:p> 
using MyPrj.IMyLib;<o:p></o:p> 
<o:p> </o:p> 
namespace MyPrj.MyLib<o:p></o:p> 
{<o:p></o:p> 
      public class Account:IAccount<o:p></o:p> 
      {<o:p></o:p> 
            private int i;<o:p></o:p> 
            public Account()<o:p></o:p> 
            {<o:p></o:p> 
                  i++;<o:p></o:p> 
            }<o:p></o:p> 
            public int setval()<o:p></o:p> 
            {<o:p></o:p> 
                  i = 20;     <o:p></o:p> 
                  return i;<o:p></o:p> 
            }<o:p></o:p> 
      }<o:p></o:p> 
}<o:p></o:p> 
--------------Interface--------<o:p></o:p> 
using System;<o:p></o:p> 
<o:p> </o:p> 
namespace MyPrj.IMyLib<o:p></o:p> 
{<o:p></o:p> 
      public interface IAccount<o:p></o:p> 
      {<o:p></o:p> 
             int setval();<o:p></o:p> 
<o:p> </o:p> 
      }<o:p></o:p> 
}<o:p></o:p> 
<o:p> </o:p> 
<o:p> Can anyone from you help me out through this.</o:p> 
<o:p>Thx in advance</o:p> 
<o:p>Sukh</o:p>

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to