Wednesday, April 13, 2011

SharePoint 2007 Alert Mail Issue

SharePoint 2007 Alert Mail Issue



I came across an issue today related to alert mail not getting delivered whenever I modify or create a task item. Initially I was not getting the alert creation email as well. Following are the steps followed
Step 1.

Check whether the SMTP server is working. Below is a simple code to verify the service is working or not.
using System;
using System.Net.Mail;
public class Program
{
public static void Main(string[] args)
{
try
{
// Check arguments
if (args.Length != 3)
{
Show();
return;
}

// Create message
MailMessage mmMessage = new MailMessage();
mmMessage.To.Add(new MailAddress(args[2] as string));
mmMessage.From = new MailAddress(args[1] as string);
mmMessage.Subject = "TestMail";
mmMessage.Body = "This is a test";

// Send message
SmtpClient sc = new SmtpClient(args[0] as string);
sc.Send(mmMessage);

}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}

private static void Show()
{
Console.WriteLine("TestMail [SmtpServer] [FromAddress] [ToAddress]");
}

}
Save the file as SMTPTest.cs
Open the Visual Studio command prompt and execute the below
>csc.exe /out:SMTPTest.exe SMTPTest.cs
>SMTPTest.exe [SMTP Server IP address][FromAddress][ToAddress]
If you receive a mail then the SMTP servvice is working fine.

Step 2.

Open the Central Administration – Operation -> Topology and Services -> Outgoing e-mail settings
Enter the outbound SMTP server address and the other details. Click OK.
Verify if the email alerts are going.

Step 3.

Open the Central Administration ->Application Management -> Web application outgoing e-mail settings
Select the web application and verify the outbound smtp server.
Verify if the email alerts are going.

Step 4.

Check out the stsadm command in the below link to verify if the alerts are enabled.
http://sharepointalert.info/
Verify if the email alerts are going.

Step 5.

Check the Windows SharePoint Services Timer Service, if it is started. If the service is not started then start the services.
Verify if the email alerts are going.
Please reset IIS if the alerts mails are not going.

Tuesday, April 12, 2011

Is HTML5 replacing SIlverlight

Please check this blog
http://team.silverlight.net/announcement/standards-based-web-plug-ins-and-silverlight/

Monday, April 11, 2011

SOLID

SOLID but for those who don’t know, it stands for Single Responsibility, Open/Closed Principle, Liskov substitution, Interface Segregation and Dependency Inversion, introduced by Robert C. Martin, which is basically a collection of principles that one should keep in mind while creating a system that’s easy to maintain and extend over time

The file is not part of the project or its Build Action property is not set to Resource

I wanted to play .wmv file in my website using the Silverlight Media Element. Here is the Syntax

<mediaelement name="media" source="Test.wmv" width="300" height="300">

But I was getting the error. "The file is not part of the project or its Build Action property is not set to 'Resource'.

I modified the Source attribute of the Media Element as shown below and it worked.

<mediaelement name="media" source="/[SolutionName];component/Test.wmv" width="300" height="300">

Wednesday, May 19, 2010

Visual Studio Color Schemes

Came across this nice website. It talks about the Visual Studio color schemes.
Visual Studio allows us to completely customize the editor background and text colors to whatever we want. Here is the link.

http://weblogs.asp.net/scottgu/archive/2010/04/29/download-and-share-visual-studio-color-schemes.aspx

Friday, April 16, 2010

Monitoring the File System

Today one of my friend asked about retrieving the Time stamp value in C# whenever a file is Renamed. I was not sure as how to achieve this. As far as I know System.IO doesn't expose any property to retrieve the time stamp value whenever a file is renamed. We can use the System.IO.FileSystemWatcher class to monitor the file system.

Wednesday, March 10, 2010

The worker process failed to initialize the http.sys communication or the w3svc communication layer and therefore could not be started.

The worker process failed to initialize the http.sys communication or the w3svc communication layer and therefore could not be started. The data field contains the error number.

On one of the customer’s server we got this error while navigating to a website. Ours is a WebClient application and we use the ClickOnce technology to publish our files to the Server.
Recently there was an upgrade happened on that system. The system was running Windows 2003 Server with Service Pack 2. It was to be upgraded to Windows Server 2003 Enterprise Edition. Unfortunately, the upgrade was not successful and in the process the registry got overwritten. IIS too get corrupted. The website was running IIS 6.
IIS 6 has Application Pool; an Application Pool can contain one or more applications and allows us to configure a level of isolation between different Web applications. Each application Pool has its own Identity. Usually, it runs with the Network Service credentials.
The Problem:
Whenever we tried opening a web site we were getting the “Service Not Available” screen. The reason was the application pool would automatically get stopped. Event Viewer was displaying the above error. Please refer to the article below for further reference.
http://support.microsoft.com/kb/896286
Troubleshoot:
We tried the above steps mentioned in the article but unfortunately it didn’t worked out. We also referred to the below link which mentioned about an issue with one of the service pack 2 updates. Please refer the article below.
http://www.pmcdonnell.ie/?p=42
None of the above resolution helped us in resolving this issue.
Following are the steps that resolved the issue.
1. Uninstall IIS
2. Re-Install IIS
3. Run the below command. If IIS is installed after .Net then we need to register the asp.net. Open the VS command prompt or go to c:\[windows/winnt]\[Microsoft.Net]\[Framwowrk]\[ v2.0.50727]\aspnet_regiis.exe –i.
4. Create the virtual directory.
5. Create the Application Pool.
6. Assign the application pool to the virtual directory.
7. Run the website.