Tom Knowlton
asked on
Linking problem?
I have this solution with lots of existing projects I have brought in.
I have been able to access the properties and methods of the other Assemblies just fine.
But even though I have added assembly called "NEOMail" and it does have a public method exposed.....it fails to show up when I try to declare a variable of that type:
http://www.knowltonfamily.com/linking_prob.gif
I have been able to access the properties and methods of the other Assemblies just fine.
But even though I have added assembly called "NEOMail" and it does have a public method exposed.....it fails to show up when I try to declare a variable of that type:
http://www.knowltonfamily.com/linking_prob.gif
ASKER
Here is the code for NEOMail:
Other assemblies have similar code and are linking in just fine!
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~
using System;
using System.Web.Mail;
namespace BuyerFund
{
namespace NEOMail
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class NEOMail
{
private string NEOEmail_To="";
private string NEOEmail_From="";
private string NEOEmail_CarbonCopy="";
private string NEOEmail_Subject="";
private string NEOEmail_Body="";
private string NEOEmail_AttachmentOne="";
private string NEOEmail_AttachmentTwo="";
private string NEOEmail_AttachmentThree=" ";
private string NEOEmail_AttachmentFour="" ;
private string NEOEmail_PriorityIfFax = "";
//if needed private ArrayList arLines = new ArrayList();
public BuyersFund.GatherMessages. GatherMess ages gmMessage = new BuyersFund.GatherMessages. GatherMess ages();
public BuyersFund.FormattingLib.F ormattingL ib formatLIB = new BuyersFund.FormattingLib.F ormattingL ib();
public BuyersFund.GeneralFunction s.GeneralF unctions genFuncs = new BuyersFund.GeneralFunction s.GeneralF unctions() ;
public NEOMail()
{
//
// TODO: Add constructor logic here
//
}
#region Setters and Getters
public string NMailTo
{
set
{
NEOEmail_To = value;
}
get
{
return NEOEmail_To;
}
}
public string NMailFrom
{
set
{
NEOEmail_From = value;
}
get
{
return NEOEmail_From;
}
}
public string NMailCarbonCopy
{
set
{
NEOEmail_CarbonCopy = value;
}
get
{
return NEOEmail_CarbonCopy;
}
}
public string NMailSubject
{
set
{
NEOEmail_Subject = value;
}
get
{
return NEOEmail_Subject;
}
}
public string NMailBody
{
set
{
NEOEmail_Body = value;
}
get
{
return NEOEmail_Body;
}
}
public string NMailAttachmentOne
{
set
{
NEOEmail_AttachmentOne = value;
}
get
{
return NEOEmail_AttachmentOne;
}
}
public string NMailAttachmentTwo
{
set
{
NEOEmail_AttachmentTwo = value;
}
get
{
return NEOEmail_AttachmentTwo;
}
}
public string NMailAttachmentThree
{
set
{
NEOEmail_AttachmentThree = value;
}
get
{
return NEOEmail_AttachmentThree;
}
}
public string NMailAttachmentFour
{
set
{
NEOEmail_AttachmentFour = value;
}
get
{
return NEOEmail_AttachmentFour;
}
}
public string NMailAttachmentPriorityIfF ax
{
set
{
NEOEmail_PriorityIfFax = value;
}
get
{
return NEOEmail_PriorityIfFax;
}
}
#endregion
//returns 0 if okay
//returns 1 if error
public int SendFax()
{
try
{
MailMessage MyMail = new MailMessage();
MyMail.From = "Administrator@buyersfund. com";
//MyMail.To = FAXMAKER_EMAIL + this.strFaxNumber + FAXMAKER_DOMAIN;
MyMail.To = this.NEOEmail_To;
MyMail.Cc = this.NEOEmail_CarbonCopy;
MyMail.Subject = "TEST .NET built-in mail";
MyMail.Body = "::p=" + this.NEOEmail_PriorityIfFa x;
//MailAttachment myAttachment = new MailAttachment(strFaxDocPa th);
//For testing...will generate exception
//MailAttachment myAttachment = new MailAttachment("sadfs");
//MyMail.Attachments.Add(m yAttachmen t);
SmtpMail.Send(MyMail);
return 0;
}
catch(Exception e)
{
gmMessage.AddMessage("IT", "There was a problem faxing. Details: " + e.StackTrace);
return 1;
}
}
}
}
}
Other assemblies have similar code and are linking in just fine!
~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;
using System.Web.Mail;
namespace BuyerFund
{
namespace NEOMail
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class NEOMail
{
private string NEOEmail_To="";
private string NEOEmail_From="";
private string NEOEmail_CarbonCopy="";
private string NEOEmail_Subject="";
private string NEOEmail_Body="";
private string NEOEmail_AttachmentOne="";
private string NEOEmail_AttachmentTwo="";
private string NEOEmail_AttachmentThree="
private string NEOEmail_AttachmentFour=""
private string NEOEmail_PriorityIfFax = "";
//if needed private ArrayList arLines = new ArrayList();
public BuyersFund.GatherMessages.
public BuyersFund.FormattingLib.F
public BuyersFund.GeneralFunction
public NEOMail()
{
//
// TODO: Add constructor logic here
//
}
#region Setters and Getters
public string NMailTo
{
set
{
NEOEmail_To = value;
}
get
{
return NEOEmail_To;
}
}
public string NMailFrom
{
set
{
NEOEmail_From = value;
}
get
{
return NEOEmail_From;
}
}
public string NMailCarbonCopy
{
set
{
NEOEmail_CarbonCopy = value;
}
get
{
return NEOEmail_CarbonCopy;
}
}
public string NMailSubject
{
set
{
NEOEmail_Subject = value;
}
get
{
return NEOEmail_Subject;
}
}
public string NMailBody
{
set
{
NEOEmail_Body = value;
}
get
{
return NEOEmail_Body;
}
}
public string NMailAttachmentOne
{
set
{
NEOEmail_AttachmentOne = value;
}
get
{
return NEOEmail_AttachmentOne;
}
}
public string NMailAttachmentTwo
{
set
{
NEOEmail_AttachmentTwo = value;
}
get
{
return NEOEmail_AttachmentTwo;
}
}
public string NMailAttachmentThree
{
set
{
NEOEmail_AttachmentThree = value;
}
get
{
return NEOEmail_AttachmentThree;
}
}
public string NMailAttachmentFour
{
set
{
NEOEmail_AttachmentFour = value;
}
get
{
return NEOEmail_AttachmentFour;
}
}
public string NMailAttachmentPriorityIfF
{
set
{
NEOEmail_PriorityIfFax = value;
}
get
{
return NEOEmail_PriorityIfFax;
}
}
#endregion
//returns 0 if okay
//returns 1 if error
public int SendFax()
{
try
{
MailMessage MyMail = new MailMessage();
MyMail.From = "Administrator@buyersfund.
//MyMail.To = FAXMAKER_EMAIL + this.strFaxNumber + FAXMAKER_DOMAIN;
MyMail.To = this.NEOEmail_To;
MyMail.Cc = this.NEOEmail_CarbonCopy;
MyMail.Subject = "TEST .NET built-in mail";
MyMail.Body = "::p=" + this.NEOEmail_PriorityIfFa
//MailAttachment myAttachment = new MailAttachment(strFaxDocPa
//For testing...will generate exception
//MailAttachment myAttachment = new MailAttachment("sadfs");
//MyMail.Attachments.Add(m
SmtpMail.Send(MyMail);
return 0;
}
catch(Exception e)
{
gmMessage.AddMessage("IT",
return 1;
}
}
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
NEOMail. does not bring up code completion for the public method SendFax( ) or for any of the Setters / Getters I have written.
ASKER
Ohhhhh......you are so right......geez I hate that!!!!!!!!!!!!
Was supposed to be BuyersFund not BuyerFund.....
Thanks,
Tom
Was supposed to be BuyersFund not BuyerFund.....
Thanks,
Tom
No problem, happens to me too.
ASKER
:)
Confirmed....it works now.
Tom
Confirmed....it works now.
Tom
Excellent!
Dean
Dean
ASKER
I want to ask you something else.....
I've noticed that you can add lots of existing projects to one solution.
Is it pretty common practice to add all company related projects under ONE solution.....for easy access, etc.?
I've noticed that you can add lots of existing projects to one solution.
Is it pretty common practice to add all company related projects under ONE solution.....for easy access, etc.?
I think it depends. If you add them all to one solution you are constantly rebuilding them which can start to effect versioning, etc., not to mention compile time. When you're in dev mode and things are all fluid, it is probably useful to keep them all in one solution. However, once you have started to lock projects down it is probably best to move them out of the solution and just reference the assembly. Especially true for assemblies that are shared by multiple applications.
ASKER
Okay....
I have noticed that I am naturally grouping set of Assemblies together for different projects I work on....and had the thought, "Hey why don't I just lump ALL OF THEM together into one big solution...???"
I think you have laid out the pros and cons of this quite nicely.
I have noticed that I am naturally grouping set of Assemblies together for different projects I work on....and had the thought, "Hey why don't I just lump ALL OF THEM together into one big solution...???"
I think you have laid out the pros and cons of this quite nicely.
ASKER
two things:
1)Does the class only have static methods? If so then you can't declare an instance, you can just use it...
NeoMail.SendMessage("");
2) Have you set your using NeoMail at the top of the class declaration?