Sunday, July 22, 2012

Adding a 'self' linked SQL Server (SQL Server R2)

To mimic a multi-SQL Server environment of one of our clients on a single server, I needed to link the SQL Server to itself. If found several suggestions by googling it, but only this one worked for me:

EXEC sp_addlinkedserver @server='alias', --the name of the linked server
                                             @srvproduct='',
                                             @provider='SQLNCLI',
                                             @datasrc='.',--the data source
                                             @provstr='Integrated Security=SSPI';

The other suggestions I found, used the same approach, but with a different provider. SQLNCLI worked for me.

Friday, July 13, 2012

Missing intellisense for aspx / masterpages in Visual Studio 2010 / SharePoint 2010 Projects

I've been working recently on a SharePoint 2010 project that I inherited from a colleague, and some of the aspx pages and the .master page did not have any intellisense, which was pretty annoying.

I've found this blogpost from Sanna Pehkonen, which states to simply open the page using the 'View Markup' option in the solution explorer (right click). And behold... intellisense is working again.

Wednesday, February 29, 2012

Free .NET decompiler from Telerik

Ever since RedGate announced that Reflector would no longer be a free tool, alternatives have emerged.

Next to ILSPY and dotPeek (and 1 or 2 others), now Telerik has it own free .NET Decompliler called JustDecompile.

I haven't tried it yet, but I'll sure give it go, as dotPeek (which I'm currently using) is really slow to load.


Thursday, February 23, 2012

Update: Windows Search and Xml files (on Windows Server 2008)

A while ago, I wrote a blog post on how change how Windows indexed xml files (see: http://blog.sdbonline.com/2011/09/windows-search-and-xml-files.html)

The idea is to let Windows index Xml files as Text files, allow you to search on Xml element tags and attribute names (instead of only element values and attribute values):
Navigate to HKEY_CLASSES_ROOT\.xml\PersistentHandler and change the default value to {5e941d80-bf96-11cd-b579-08002b30bfeb}
See my previous post for a more detailed explanation

This works for Windows 7 and Windows 2008 (R2) (and also on Windows Vista), but for Windows Server 2008 (R2), you will need take a few additional steps:

Add the 'File Service' Role if not already added


Add the 'Windows Search Service' in the 'Role Services' of the 'File Service' Role.


Select the locations to index (this can always be modified afterwards)


Modify the registry and rebuild the index


Verify that xml files are now indexed using the 'plain text filter'

go to 'Control Panel' - 'Indexing Options'. Click advanced, and on the 'File Types' tab, verify that the xml extension is using the 'Plain text Filter'



Make sure to wait for the indexer to complete: on my last test, my test file (in the root folder of my drive) didn't get indexed until the end



Once completed, you can search for all the content in an xml files as it was a text file (e.g. element tag names will be found)


Note that you can do the same for other file type (e.g. xslt, xsl, ...) by modifying the registry for those file types
HKEY_CLASSES_ROOT\<file extension>\PersistentHandler
and set the default value to {5e941d80-bf96-11cd-b579-08002b30bfeb}



Wednesday, February 22, 2012

ULSViewer tool not working on real-time logs

I use ULSViewer  a lot when debugging SharePoint issues. One of the nicest features of the tool is to view the SharePoint log in real-time (and the fact that is works for both SP2007 and SP2010).
Last time I wanted to use the tool, I found that it was not parsing the SharePoint log in real-time. I was however able to open individual log files.
As it turns out, ULSViewer is using *-????????-?????.log as a filter to parse the logs in real-time. I had some 'older' log files in the LOGS folder that were not formatted in the ULS format (from running powershell commands).
Removing these files from the SharePoint Logs folder got ULSViewer real-time parsing working again.