grab our rss feed

stevienova.com

Homepage of Steve Novoselac

Entries Tagged ‘.NET’

warning CS0618: ‘System.Web.Mail.SmtpMail’ is obsolete:

Previously in .net 1.0 and 1.1, to send mail from a console application, you could use
using System.Web.Mail
and use a method similar to this:
static void SendMail()
{
MailMessage msg = new MailMessage();
msg.To = “toaddress1@whatever.com,toaddress2@blah.com”;
msg.From = “fromaddress@whatever.com”;
msg.Subject = “My Subject”;
msg.Body = “My Body”;
msg.BodyFormat = MailFormat.Html;
SmtpMail.SmtpServer = “yourmailserveraddressorip”;
SmtpMail.Send(msg);
}
If you then upgrade to .net 2.0, you will get this when building:
warning [...]

Comments (1) | 110 views

.NET: Redirect URI cannot contain newline characters.

if you are doing a Response.Redirect, and are seeing this error, try something like this
string url = someUrlWithNewLines;
url.Replace(”\n\r”, “”)
Response.Redirect(url);
Seems trivial, but I have seen the error crop up many times. Just for kicks I did a Google search on it, and a lot of people are asking about it, but no real answer. So, here [...]

Leave a Comment | 62 views

Professor Nova - BCIS .NET Class

Last week, I had the pleasure of “guest lecturing” at SCSU (my alma mater) - To the BCIS .NET Class. The first class, was ASP.NET Basics. The second was extending ASP.NET to connect to a database, which we created a mock employee directory in about 40 minutes. The experience was good for me and hopefully [...]

Comments (3) | 76 views

Unit Testing Verisign Payflow Pro with VS2005

When you set up payflow pro on a system, you usually are going to use it through the web, you usually dump the certs folder into the inetsrv folder and it works fine. Thing is, when you are using VS2005 Unit Testing, you arent on the web, you can even try setting an HttpContext, but [...]

Leave a Comment | 188 views

Caching got you down? Try an Object Lock

If you are using caching in ASP.net, and when your cache invalidates, you see some really bad performance or race conditions, you probably need to implement object locks.

Object myObjectLock = new object();
//Use the lock statement to ensure that only one request
lock (myObjectLock)
{
//check again if the cache is not populated by another request
if (HttpRuntime.Cache["myCacheKey"] == null)
{
DataTable [...]

Leave a Comment | 82 views

CruiseControl.NET - Customize Your Project List with .NET Remoting

I had a need to customize a cc.net project list, and if you install CCTray, in c:\Program Files\cctray you will see 3 dll’s.
ThoughtWorks.CruiseControl.CCTrayLib
ThoughtWorks.CruiseControl.Remote
NetReflector
Note: If you have the latest CCTray installed, then you will have to develop any custom application in .NET 2.0
So first this, you need to reference those 3 dll’s, and add a using [...]

Leave a Comment | 147 views

.NET Execute Process with Arguments

if you are trying to execute a process in .net and trying to pass in arguments, and seem to not be getting anywhere, in the “start info”, set UseShellExecute = false. Worked for me :)

Leave a Comment | 77 views

.NET Framework Mistake

I think the .NET Framework is great. It is great for web and fat client apps, web services, etc. I think the mistake Microsoft made with it, is it isn’t required with the OS. Too many people don’t have it. It isn’t feasible to develop a fat client app with .NET and expect widespread installations. [...]

Comments (5) | 106 views

PocketBlogger 1.3 Released

I just released PocketBlogger 1.3 which adds support for MSN Spaces. Here is my post over at pocketblogger.net if anyone is interested
Version 1.3 Released (MSN Spaces Support)

Leave a Comment | 82 views

Enum or Lookup Table (Or Both?)

Well, here is a dilemma. Should you use an Enum in code or a Lookup Table in the DB for static lookup data. Or should you use both and make sure they match up? And if you do, should you make the tables have an identity INT column?
Depends on the situation.
If you have a lookup [...]

Leave a Comment | 228 views