by Pieter Brinkman
7. May 2009 05:34
When deploying a WCF webservice for a Silverligh application I got the following error:
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: System.ServiceModel.Description.DataContractSerializerOperationBehavior
contract: http://tempuri.org/:IWebService ----> System.Runtime.Serialization.InvalidDataContractException: Type 'Project.service.HU_BACH.ScPlacemark' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.
As you can see from the error you need to add the [Serializable] attribute to all objects that are used within the webservice. After I did this I got the same error for my Linq to Sql objects generated within my DBML. You can make your Linq to Sql objects serializable by changing the dbml setting Serialization Mode to Unidirectional.
Hope it helps.
by Pieter Brinkman
2. February 2009 09:53
After running WCF on my Vista laptop (IIS7) I needed to deploy the application on some Windows XP computers. Again some strange errors occurred:
[code:html]
Error Description: "This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item"
[/code]
The problem is that WCF cannot handle more than one identity (host headers) per website. At first I configured IIS to have one HostHeader. That solution was just to dirty. So I kept on searching the internet.
You can fix this problem by adding prefix-key(s) in the baseAddressPrefixFilters section of the Web.Config:
[code:xml]
<system.serviceModel>
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix=”http://www.local.develop”/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
</system.serviceModel>
[/code]
Hope this helps.
Sources:
http://geekswithblogs.net/robz/archive/2007/10/02/WCF-in-IIS-with-Websites-that-have-Multiple-Identities.aspx
http://blogs.msdn.com/rampo/archive/2008/02/11/how-can-wcf-support-multiple-iis-binding-specified-per-site.aspx
by Pieter Brinkman
22. December 2008 09:51
While playing with IIS 7 I accidental destroyed my IIS (XML) settings file. To fix this problem I copied the .XML from a colleague PC to mine. After this my IIS started giving a strange error:
HTTP Error 404.17 - Not Found - The requested content appears to be script and will not be served by the static file handler.
After a quick search I found out that I copied the .XML from a 32 bit PC to my 64 bit Vista and that all my Application Pools where now running on 64-bit. So my application stopped working because it's 32 bit.
To fix this problem go to IIS, right click your Application Pool and set the Enable 32-bit Applications to true.
by Pieter Brinkman
2. September 2008 05:33
When I was trying to publish a database to my shared hosting provider I encountered some problems with backup and restoring my database. To restore a database on my provider I needed a full Sql script (schema and data).
After a few attempts with SQL comparer and Management studio I found a link to ‘Microsoft SQL Server Database Publishing Wizard 1.1’. The Publising Wizard does complete backups to SQL script (including data).
When I tried running the Publishing Wizard on my Vista workstation it failed with the following error:
Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I fixed this error by installing the ‘Feature Pack for Microsoft SQL Server 2005 - November 2005’.
The Publishing Wizard a great tool!