Wednesday, May 22, 2013

GacUtil Commands

Use:
gacutil -i "path and name of dll"
to install an assembly in the Global Assembly Cache

Use:
gacutil /u "name of dll without the extension"
to uninstall an assembly in the Global Assembly Cache

GacUtil is a command line utility that comes with Visual Studio.  Just open up the Visual Studio Command Prompt found in the Start Menu.  Make sure you run it as an administrator.

.evt versus .evtx log files

"Classic" .evt log files do not necessarily convert to the new .evtx format.  This becomes an issue when you get sent a log from a Windows Server 2003 server, and need to examine it using the Event Viewer on your Windows 7 pc.  Sometimes you can use Event Viewer's "Save all events as" feature to convert the file to a .evtx file, but this does not always work.  Occasionally you get a "The data is invalid" error.  When this happens, the only way I know of to efficiently examine the log file is to copy it over to a Windows Server 2003 server, and look at it using the old Event Viewer.

Tuesday, May 21, 2013

SharePoint pages are extremely slow to load when debugging

I was debugging a SharePoint project today, and noticed on one of the pages that it took forever to load the page.  It was so slow, you could see the individual controls being painted on the screen.  It only did this while debugging from Visual Studio (2010 in this case).  After some research, I found that turning off IntelliTrace fixed this problem.  This can be done by clicking Debug, Options and Settings, IntelliTrace, and then uncheck the Enable IntelliTrace option.

Friday, May 17, 2013

Delete a sub-site using command prompt

On the SharePoint web server, open a command prompt as administrator.

"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\stsadm" -o deleteweb -url "url of subsite goes here"

Tuesday, May 7, 2013

SharePoint .net framework version

When writing code that interacts with SharePoint 2010, you have to make sure your project compiles using version 3.5 since this is the version that SharePoint 2010 uses.  By default Visual Studio 2010 will use version 4.0.

"14 Hive" location

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14

Property Bag Stuff and SharePoint 2010 Web Services

If you need to access a site property that is stored in the "property bag", you're not going to be able to use any of the SharePoint web services to get at it.  Unfortunately, the only way this is possible is through the object model (specifically SPWeb.Properties).  And of course, this code has to run on the web server.  The advantage of the web services is you can run them anywhere, but as you can see, there are some limitations.