Sunday, April 17, 2011

This collection already contains an address with scheme Http. There can be at most one address per scheme in this collection

Recently, I deployed my fully tested WCF service to a shared hosting environment and I was greeted by this nasty message the first time I tried to test my service by entering the url in the address bar. Upon researching the issue I realized that my ISP had allowed my service to be accessible using multiple host names. Obviously, I did not have access to their IIS, so had to come up with an alternate solution. In my solution, I created a custom ServiceHostFactory and forced WCF to use this host factory.

1. Create a new class that inherits from the ServiceHostFactory.
2. Override the CreateServiceHost, create a new servicehost type with the Uri of that you want the service to bind to and return the new servicehost from the CreateServiceHost method.
 3. Change the .svc file of your service to use the new custom service host that you have created. This is done by providing the namespace name of your servicehost in the Factory attribute of the .svc file.


Hope this helps.

Wednesday, February 23, 2011

Error 500.19. MSSQL Server 2005 Reporting Services and Windows 7

I recently started working with SSRS once again after a sabbath of 4 years and tell you what....it was kinda difficult to recollect everything. Well for once I was working on a new OS with an old version of SQLServer. I installed SqlServer2005 and reporting services, the fired up the reporting services configuration editor to setup my reporting server. Following are the caveats that you need to remember for a sucessful install and initialization of reporting services.
Since SSRS uses .Net framework 2.0 do not use the default AppPool to run your reporting services (the default app pool in my case was using .Net framework 4) . It will make your life hell. To resolve this, open up IIS manager on your windows7 machine and click on your report server site. In the Actions pane click Basic Settings and then the Select button in the 'Edit Application' dialog box. This will open another dialog box that should let you change the app pool that your report server is using.
Since the report server virtual directory is installed under \%systemdrive%\Program Files (x86)\Microsoft SQL Server\MSSQL.3\Reporting Services, Windows7 will not let you run the site using the IUSR account. You will have to expressly grant the IUSR account read permission in the least. This was the reason in my case for Error 500.19.
Hope this helps. Enjoy!

An unknown error has occured in the WMI Provider. Error Code 8000000A

Recently while using reporting services configuration editor on a Windows 7 machine I ran into this error. On first look, I thought I was toast and would have to spend oodles of hours trying to fix it. The solution is pretty simple.....run the reporting services configuration editor as an administrator and this annoying error should go away. Would be helpful if Microsoft could put a little hint in the error thrown something like 'Are you running the configuration editor as an administrator?', kinda like the missing assembly reference hint on a typical .Net compile. Dont you agree?

Wednesday, October 27, 2010

Setting up a 'RAM Drive' and deploying your windows mobile app.

Recently I have started doing windows mobile development and to my dismay the storage space for programs on the emulator is limited to 32 MB by default. Well, that would obviously not work especially when you are deploying WCF related namespaces alongwith your other project dependent assemblies.
Luckily, there is a work around to this problem. You can setup a virtual storage card on your device that points to a local drive on your development PC. This is how you would do it. I am using a Windows Mobile 6 Professional Emulator

1. Fire up the emulator from within Visual Studio (Tools -> Device Emulator Manager).
2. Click File -> Configure from the menu.
3. On the General Tab, towards the bottom you will see a place holder for your Shared Folder.
4. Click browse [..] and select the folder on your local machine you would like to use as a virtual storage card.
You should now be able to see details of your storage card on your device.

DEPLOYING your windows mobile app to the device and debugging in VS (I am using VS 2008).

1. In VS, right click your project and select properties.
2. Click the devices tab.
3. Click on the ellisis [..] button beside the Output file folder.
4. Select Root folder from the drop down and specify a path (subdirectory) where you would like VS to deploy your application.
5. Select Ok and you should be in business.