Tuesday, October 5, 2010

Dealing with error "Login failed for user ‘IIS APPPOOL\DefaultAppPool" on Windows 7.

The cause of this error is that a login is being attempted to a database with the "ApplicationPoolIdentity" account. In a development environment, you would prefer using your credentials to log into a SQL Express database. This can be fixed by doing the following:

  • Go to IIS Manager
  • Click on Application Pools
  • Click on the offending application pool
  • Click on the "Advanced Settings ..." link on the right-hand-side
  • Find the "Identity" property and change it from "ApplicationPoolIdentity" to "LocalSystem"

Thursday, August 19, 2010

How to display the ID number on edit and display forms in SharePoint 2007?

  1. We will use the content editor webpart to add Javascript that will display the ID. However, most edit and display forms do not allow you to add a webpart. This can be easily rectified by adding "&ToolPaneView=2" to the URL in the browser address line.
  2. Add a content editor webpart right above the form. Set the "Chome Type" to none in the "Appearance" section of the webpart.
  3. Click on the "Source Editor" button of the webpart.
  4. Add the following HTML/Javascript:
<script type="text/javascript">

//
// Item ID in DispForm.aspx and EditForm.aspx
//
function DisplayItemID()
{
   var regex = new RegExp("[\\?&]"+"ID"+"=([^&#]*)");
   var qs = regex.exec(window.location.href);
   var TD1 = document.createElement("TD");
   TD1.className = "ms-formlabel";
   TD1.innerHTML = "<h3 class='ms-standardheader'>ID</h3>";
   var TD2 = document.createElement("TD");
   TD2.className = "ms-formbody";
   TD2.innerHTML = qs[1];
   var IdRow = document.createElement("TR");
   IdRow.appendChild(TD1);
   IdRow.appendChild(TD2);
   var ItemBody = GetSelectedElement(document.getElementById("idAttachmentsRow"),"TABLE").getElementsByTagName("TBODY")[0];
   ItemBody.insertBefore(IdRow,ItemBody.firstChild);
}
_spBodyOnLoadFunctionNames.push("DisplayItemID");
</script>

Saturday, July 24, 2010

Are you:
  • a developer in Greater Vancouver area?
  • curious about the evolving trend toward "Rich Interactive Applications" (RIA) on the web?
  • interested or involved in Silverlight development?
  • looking to take advantage of new opportunities offered by Microsoft's upcoming release of the Windows Phone 7 platform?

The newly formed Vancouver Silverlight User Group is putting out the call for new members and now is a great time to get involved with this powerful and creative technology

DevTeach's Jean-Roy Rene has generously offered a free registration to their "Windows Phone 7 Bootcamp" being held in Vancouver on August 30-31, 2010 as an incentive for new members to join the VanSLUG community.

As an additional incentive for all new members, we will be holding an exclusive presentation by Colin Melia, the Bootcamp trainer) to our registered membership around the time of DevTeach/Bootcamp being held in Vancouver (TBD, sometime near the end of August).

Whether you are looking to improve your professional understanding, a way to express your creative curiosity or to find a place to network with your peers, we look forward to meeting you at our presentations and events.

For more information on VanSLUG, the Vancouver Silverlight User Group, please check out: http://www.vanslug.net/For more information on DevTeach please check out: http://www.devteach.com/For more information on Windows Phone 7 Bootcamp, please check out: http://www.devteach.com/SpecialEvent.aspx

Sunday, May 9, 2010

Installing DotNetNuke (DNN) under Windows 7

Many of my students at BCIT have asked me for help with the installation of DotNetNuke (DNN) under IIS 7 on Windows 7. This is a little bit different from previous Windows operating systems because of the security model and the default application pool account that IIS 7 uses.

The prerequisite is to have SQL Server Express and the IIS feature activated on your Windows 7 environment.

Here are the steps that I recomended to my students:

  1. Download DNN from http://dotnetnuke.codeplex.com/releases/view/44102 and install it in a directory like c:\DotNetNuke
  2. Copy "release.config" to "web.config" in the root directory of DNN
  3. In IIS 7 add a "New Application" under the "Default Web Site" pointing to the location where DNN was installed (like c:\DotNetNuke).
  4. Create a new application pool named "dnn" in IIS 7. Changed "Load user profile" property to "False" by clicking on the "Advanced Settings" link of the "dnn" application pool.
  5. Set the application pool for your "Default Web Site" to "dnn" by clicking on the "Basic Settings" link
  6. Give the physical directory of your site (I.E. c:\DotNetNuke) full access permission to account "IIS AppPool\dnn"
  7. Point your browser to http://localhost/DotNetNuke. If all goes well you will enter the DNN configuration wizard.

Vancouver Silverlight User Group (VanSLUG.NET) Launch

On May 5, 2010 I launched the Vancouver Silverlight User Group which I named VanSLUG. The group's web site is at http://vanslug.net/. The first meeting was held at BCIT and was co-hosted by VanSPUG, .netBC, and VanSLUG. Habaneros sponsored the snacks. We had attendance of over 80 people.

The speaker was Laurent Duveau, who is a Silverlight MVP from Quebec City. He gave a talk entitled "Silverlight 4 Business Applications". His presentation was very well received and he got many questions from the audience. He has blogged about the event at:

http://weblogs.asp.net/lduveau/archive/2010/05/09/my-talk-at-the-launch-of-the-vancouver-silverlight-user-group.aspx

You can download his presentation and examples from the above site.

Thursday, May 6, 2010

Getting FTP to work on Windows 2008 server

I installed the FTP server feature on a Windows 2008 server. However, when I tried to connect from an FTP client, I consistantly got an error suggesting that the directory could not be listed, even though authentication went through. I checked the Windows Firewall setting and found that "FTP Server" was indeed checked in the exceptions list. A quick google saved my day. You can configure the Windows Firewall to allow non-secure FTP traffic with these two command-line commands:

1) Open port 21 on the firewall
netsh advfirewall firewall add rule name="FTP (no SSL)" action=allow protocol=TCP dir=in localport=21
2) Activate firewall application filter for FTP (aka Stateful FTP) that will dynamically open ports for data connections
netsh advfirewall set global StatefulFtp enable

Kudos to this site: http://social.msdn.microsoft.com/Forums/en/winserver2008appcompatabilityandcertification/thread/72ea0c7d-1071-4637-a38f-e77195e8a738

Sunday, April 18, 2010

Installing "RIA Services" on IIS 7

To install "RIA Services" in an IS 7.x environment:

1) Download the "RiaServices.msi" file from the Microsoft download page for "WCF RIA Services Release Candidate 2 for Silverlight 4 and Visual Studio 2010".

2) Since you are not expected to have Visual Studio .NET 2010 on the server, it suffices that you only install the assemblies into the GAC. This is done by installing the msi file with these command line swithches:

msiexec /i RiaServices.msi SERVER=TRUE

Saturday, April 17, 2010

Cannot uninstall "WCF RIA Services Beta"

There is a bug in "WCF RIA Services Beta" software that makes it almost impossible to uninstall it from add/remove programs in windows. The side effect is that you cannot install the "Silverlight tooks for Visual Studio 2010" without completely uninstalling "WCF RIA Services Beta".

I found this article that proposes a brute force solution to this problem:

http://forums.silverlight.net/forums/p/149912/334721.aspx