Thursday, January 28, 2010

Client cannot connect to remote SQL Server over TCP/IP

a) Make sure Remote connections are enabled on the SQL SERVER instance.
b) Configure your firewall to allow connections through the desired ports.

Default SQL SERVER instance uses port 1433 for TCP/IP

1. Open the Windows Firewall with Advanced Security
2. Right Click on inbound rules and select New Rule
3. Create a Port Rule, Click Next
4. Choose TCP rule and choose ports 1433, 1444. Click Next.
5. Choose Allow the connection. Click Next.
6. Choose the correct profile. By default all of them are on, but you might choose only to let domain machines access SQL... Click Next
7. Specify a Name and a Description for the Inbound Rule. Click Finish
8. Your rule should be created

Now use your client to connect to the Remote SQL SERVER instance and it will work.

Data at the root level is invalid. Line 1, position 1

I got this error "Data at the root level is invalid. Line 1, position 1" when I tried to read an XML file using C#.

Initially I was checking whether the XML is well formed and tried opening in IE to make sure whether it opens fine. IE didn't show any errors and my XML document was fine.

I couldn't figure out what's gone wrong. After a few minutes I realised that I was using XML.LoadXML() instead of XML.Load().

Actually I had my code initially to load an XML string so I was using XML.LoadXML() but changed the logic to load an XML document but forgot to change the code to XML.Load().

XML.Load() - to load an XML File
XML.LoadXML() - to load a XML String

Wednesday, January 27, 2010

Attempted to read or write protected memory

I am getting the following error in the Event Viewer continously.

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Services that trigger this error:

Windows Sharepoint Services 3
Office Sharepoint Server


Install this hotfix to stop the errors.

This fix is for IIS 6 and IIS 7;EN-US;946517

Application Server Administration job failed for service instance

I changed the service accounts for the following services which are part of my Search Server 2008 Express installation. The Central Administration and Search Administration websites stopped working after that.

Windows Server 2008 64 bit OS

I checked the Event Logs and the following error message was recorded.

"Application Server Administration job failed for service instance"

The above error occurred for the following services.

Windows Sharepoint Services 3
Office Sharepoint Server

I ran the following commands which fixed the above issue and the Central and Search administration pages started working.

1) net stop osearch
2) net start osearch
3) iisreset /noforce

Tuesday, January 26, 2010

AspNetHostingPermission Security Exception Fix in IIS7

I used the ASP.NET Server Control, part of Search Server Community kit in an Intranet site.

The Intranet site was running on IIS 7 and the application pool running on Classic mode. (need to make some changes to run on Integrated pipeline) mode.

Deployed the search page and placed the Microsoft.SearchToolkit.DotNetSearchControls.dll in the bin folder.

Tried loading the search page and got the following error.

System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Set 'Load User Profile' to true for the application pool and it will fix the above security exception.

Monday, January 25, 2010

Search Server Express 2008 Installation & Configuration

I worked on implementing Search Server Express 2008 for an Intranet Website. The installation process was a bit confusing as I was trying to do a Advanced installation (Web & App server and a separate SQL Server). I tried doing the basic installation on a VM to understand the installation steps and then tried the advanced installation.

Couple of things where I spent time are

a) Configuring crawling of PDF Files.

Since I was installing Search Server Express 2008 on a Windows 2008 64 bit server, I installed the Adobe PDF IFilter 9 for 64 bit platforms []

Then did the following.

1. Add the filter extension to the file types crawled.

Start > Program > Microsoft Office Server > Sharepoint 3.0 Central Administration > > Search Settings > File Types > New File Type (Add PDF extension)

3. Modify the following Registry keys by changing their "Default" value to the new CLSID of the Adobe IFilter: {E8978DA6-047F-4E3D-9C78-CDBE46041603}

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf
Default --> {E8978DA6-047F-4E3D-9C78-CDBE46041603}

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf

Default --> {E8978DA6-047F-4E3D-9C78-CDBE46041603}

4. Add PDF icon to the PDF extension

1) Copy the .gif file that you want to use to the following folder:

Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Images

NB: Make sure that the gif is 16 x 16 pixels.

2) Open the Docicon.xml file in Notepad. The Docicon.xml file is located in the following folder:

Drive:\Program Files\Common Files\Microsoft Shared\Web server extensions\60\Template\Xml

3) In the [ByExtension] section of the Docicon.xml file, add the following line, where NameofIconFile is the name of the .gif file:

[Mapping Key="pdf" Value="NameofIconFile.gif"/] ... e.g. [Mapping Key="pdf" Value="icpdf16.gif"/] Note: Replace '[' with < and > symbols.

b) Best bets not working

When I do a search for a given term in the Search Center site, the Best Bets come up before the results. But when I do the same search with my customised search page using the Web Service the best bets are not returned.

Solution: Use the URL you used to setup your keywords and best bets for the webservice and it will work. For eg. http://[website name used to setup keywords]/_vti_bin/search.asmx

Please let me know if any one has any issues with the installation of Search Server Express and I am happy to share my experiences.