VS.NET 2010 (and above) Users Click Here   

HOMECONTACT PRODUCTS DOWNLOADS PURCHASE TESTIMONIALS FORUMS COMPANY CONTACT
Home
Products
Downloads
Purchase
Licensing
Licensing FAQ
Software Updates
Support Forums
Testimonials
Feature Requests
Guarantee
About Us
Contact Us
Hosting Companies
Privacy Policy
   
Shopping Cart


Search

Using Advanced Intellect's Products in VS2010/2012

by Dave 9. November 2010 01:46

** NOTE: ALL OF OUR PRODUCTS RUN ON ALL VERSIONS OF .NET. **

The instructions below are for people using VS2010 and beyond.

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

As more and more people are upgrading to VS2010, and beyond, I am getting more of the following emails:

aspNetEmail (or any of our other products) doesn't work in later versions of Visual Studio. I usually get one of the following errors:

"aspNetEmail is not declared, it may be inaccessible due to its protection level."

Or

"The referenced assembly "…" could not be resolved because it has a dependency upon System.Web (or some other internal .NET namespace).  Please remove references to assemblies not in the targeted framework or consider retargeting your project"

Usually these exceptions occur when the developer is building a client side application.

Starting in VS2010, VS tries to be too smart for it's own good.  When you build a client application (console.exe, winform, etc…) VS limits the number of namespaces you need access too, because it thinks you shouldn't need them.

To change this behavior, what you need to do, is change the target framework from a subset of namespaces, to all of them.

To change this, in VS.NET Solution Explorer, Right-Click on  your project, an select Properties.
 
On the Application tab, set the Target Framework to be ".NET Framework XX". By default it is set to ".NET Framework XX Client Profile".  Press Ctrl-S for save, and you are done.

Below are 2 pictures that display changing the target framework.

As always, if anyone has any questions, feel free to contact me.

Thanks!
Dave Wanta

 

C# Screenshot:

 

VB.NET Screenshot (this option is found under the Compile tab. Then, click the "Advanced Compile Option" button.

 

Performing a Timed Validation with aspNetMX

by Dave 8. October 2010 04:56

I recently received a request about how to validate an email addresses, using aspNetMX, and set a timeout (thanks Co┼čkun)

To use aspNetMX, and specify a timeout, you need to use one of the following techniques.

If you are using a newer version of aspNetMX you will need to call the new overloaded Validate method. For example:
  

	string emailText = "test@example.com";
	MXValidate mx = new MXValidate();
	bool timedOut = false;
	MXValidateLevel level = mx.Validate( emailText, MXValidateLevel.Mailbox, 1000, out timedOut );

	If( timedOut )
	{
	
	  //record the validation timed out
	}
	else
	{
	   //record the validation did NOT time out
	}

If you are using an older version of aspNetMX, you can still do this. However, it will require a bit more programming. You will need to wrap the Validate method in an asynchronous call.  Here is a code example that demonstrates this.

 

bool TimedValidation( int methodTimeout, string emailAddress, MXValidateLevel maxValidation, out MXValidateLevel result )
{
	MXValidate mx = new MXValidate();
	bool success = false;
	result = MXValidateLevel.NotValid;
	


	IAsyncResult asyncResult = mx.BeginValidate( emailAddress, maxValidation, null, null);
		try
		{
			asyncResult.AsyncWaitHandle.WaitOne( methodTimeout, false);
			if (!asyncResult.IsCompleted)
			{
				success = false;
				return success;
			}
			else
			{
				//we were successful
				success = true;
				result = mx.EndValidate( asyncResult );
			}
		}
		catch (Exception ex)
		{
			//Log any exceptions here...
			Console.WriteLine( ex.ToString() );
		}

	return success;
}

In that example, you are passing in a parameter called methodTimeout. This is the number of milliseconds to wait until the Validate method times out.

As always, if anyone has any questions, feel free to contact me, over at the ContactUs page.

Thanks!
Dave Wanta

 

 

Testimonial

Last year I bought components from both you and from [xxx]. [xxx]'s support is horrendous, to say the least (you have to hate it when you, as a customer, clearly know more about the product than their support personnel). Good work on your frighteningly prompt support. "

Fraser T.

Read more testimonials
ListNanny aspNetDNS aspNetEmail aspNetPOP3 aspNetMX IPMuncher aspNetMIME aspNetPING aspNetTraceRoute aspNetIMAP aspNetMHT