The system cannot find the file specified. (2147942402, 80070002)

by Iain Angus 25. March 2010 13:41

After updating the TFS 2010 client from Beta2 to RC on my SharePoint development machine I found that I couldn’t control IIS using IISRESET, with a message usually of the following format…

Attempting stop…

Stop attempt failed.

The system cannot find the file specified. (214794202, 80070002)

As anyone who does SharePoint development knows, not being able to restart IIS periodically is a bit of a annoyance and I didn’t want to keep going into IIS Manager to do this.

Turns out this is a problem with uninstalling Microsoft .NET 4.0 Beta 2 and the solution is to repair the Microsoft .NET Framework 4 Client Profile.

Tags: ,

Technical Tips | Visual Studio

SUBST, GAC and SharePoint

by Iain Angus 6. May 2008 12:58

Working with SharePoint, sometimes you just have to install assemblies to the GAC. An example of this I have had to deal with recently was writing a webpart to access methods in the UserProfileManager class.

Debugging GAC installed assemblies can be a bit frustrating, hopefully the following steps will make it alot easier and obvious....

1. Install the assembly into the GAC

2. Map a drive using SUBST to %SYSTEMROOT%\assembly

SUBST maps a drive to a path - http://www.microsoft.com/technet/archive/msdos/07_refer.mspx?mfr=true 

A mapped drive does not use the Assembly Cache Viewer and will show you the true folder structure.

3. Locate and open the GAC_MSIL folder in the mapped drive

4. Locate and open the folder containing your assembly. The name of the folder is the same as the assembly name.

5. Copy the pdb (program database) file from your project build folder to your assembly folder in the GAC. Because you have mapped a drive to %SYSTEMROOT%\assembly you should be able to do this easily with Windows Explorer.

6. Do an iisreset /noforce (this is not really required but usually helps - general rule of thumb for working with SharePoint).

7. Go to Visual Studio and attach the debugger to the w3wp.exe (remember there may be more than one depending on how many app pools you have).

You should now be able to hit the breakpoints you have set.

Tags: ,

SharePoint | Visual Studio