Wednesday, March 4, 2009

Setting up SMTP on an asp.net development server.

This article outlines the steps necesssary to get the emails dropped into a directory on my development machine. It took me quite a while so here is the useful information.

Architecture
Visual Studio 2008
IIS 7
Windows 7

Step 1 - web.config Settings












Step 2 - Directory Permissions
Ensure that the location you set here:
pickupDirectoryLocation="c:\Temp\MailDrop\"

that the "Network Service" user has write access to.

Step 3 - Check code
Check your code is not overwriting these default permissions when creating the SMTP Object

Dim objSMTPServer As New Net.Mail.SmtpClient
objSMTPServer.Host = strSMTPServer objSMTPServer.Port = ConfigurationManager.AppSettings("SMTP_Port")
etcc..

Saturday, January 17, 2009

Back-up and Re-install IIS Settings (Vista – Windows 7)

I have to say that I am very impressed with Windows 7.  It appears in all essence to be the operating system Vista should have been.  The main  improvements I can see are:

  • Noticeably faster.
  • Drivers for USB wireless worked.
  • Windows Explorer is a lot lot better.

To the task at hand, I am developing on Windows 7 and need to transfer my IIS settings from Vista. 

Step 1 – Backup Settings on Vista

Therefore I loaded up vista and ran the following command to back-up IIS.

%windir%\system32\inetsrv\appcmd.exe add backup "My Backup Name"

Step 2 – Copy Settings from Vista to Windows 7

Any backups you make are stored in this folder:

C:\Windows\System32\inetsrv\backup\

Please ensure that they exist on the machine you are restoring too.

Step 3 – Restore settings on Windows 7

Then I logged into Windows 7 and ran this command:

%windir%\system32\inetsrv\appcmd.exe restore backup "My Backup Name"

My Attempt Failed 

After booting up IIS whereas before it showed all the usual menus and navigation tree on the left.  Now it shows nothing but the computer name at the top node.  I have to re-install IIS to get the default settings back, but I can’t restore my old settings.

When I tried to restore I get this error message:

image

Does anyone have any ideas?

Monday, November 10, 2008

Nested application does not authenticate correctly with parent application.

If you have a sub application which is nested in your main site in asp.net and the forms autentication is not working.  Check that the nested application web.config does not have a mochine key setting.

Wednesday, November 5, 2008

URLUrlRewritingNet.UrlRewriter.dll and IIS7

URL Rewriter here can take some configuration for IIS 7 and Vista.

http://urlrewriter.net/index.php/support

To configure correctly please read this entry in this blog:

http://www.improve.dk/blog/2006/12/11/making-url-rewriting-on-iis7-work-like-iis6

Sunday, November 2, 2008

You must be a member of the Administrators group on the local computer to access the IIS metabase. Therefore, you cannot create or open a local IIS Web site. If you have Read, Write, and Modify permissions for the folder where the files are located, you can create a file system Web site that points to the folder in order to edit the files.

Problem
Open Visual Studio 2005 and open website via IIS the following message is shown:

"You must be a member of the Administrators group on the local computer to access the IIS metabase. Therefore, you cannot create or open a local IIS Web site. If you have Read, Write, and Modify permissions for the folder where the files are located, you can create a file system Web site that points to the folder in order to edit the files."

Solution
I then remembered an IIS 6 option under the Windows Features install dialog under Internet Information Services and found the following option that allows VS 2005 to play with IIS 7....IIS Metabase and IIS 6 configuration compatibility.  Here are the steps:
  1. Open Control Panel
  2. Open Programs
  3. Open Windows Features
  4. Expand Internet Information Services
  5. Expand Web Management Tools
  6. Expand IIS 6 Management Compatibility
  7. Check IIS Metabase and IIS 6 configuration compatibility
  8. Click OK
http://blogs.msdn.com/jorman/archive/2006/06/06/vista-iis-7-local-iis-web-site-error.aspx
 

Friday, October 17, 2008

CLR has been unable to transition from COM context for 60 seconds

Error Message:
"The CLR has been unable to transition from COM context 0x197060 to COM context 0x196ef0 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations."

Solution:
1) I've read a few things about a config file, but I couldn't get this to work reliably. Instead, you can switch the MDA off by going to:  Debug -> Exceptions -> Managed Debug Assistants and unchecking the ContextSwitchDeadlock item.

2) Don't see that option?  Then you may have SP1 in Visual Studio 2005.  To activate the window use this shortcut:  "Ctrl-Alt-E" opens the window"

Tuesday, September 9, 2008

"please wait while windows configures itunes"

Problem
If you get this message after upgrading or installing itunes:

"please wait while windows configures itunes"

Followed by a reboot message that never fixes it self after a reboot.

Solution
From : http://discussions.apple.com/thread.jspa?messageID=5440570

go to start menu --> run
type regedit, press enter
go to computer/hkey_classes_root/
find pcast and right click it
click permissions
during the course of this you may get a message saying you cant change anything, but you can change who can change things. click ok on it.
click advanced, then owner tab
change the owner from administrator to whatever name you are using
click ok twice to get out of the pop-ups completely
right click pcast again
click permissions
click OWNER RIGHTS
by full control and read click the allow boxes.
click ok
all set!