WCF solution and MSBuild
We have a huge project going with multiple asp.net web services & asp.net web site in place. Recently, I added an WCF service to achieve an new business requirement.
My WCF service is going to be hosted by IIS and it will co-exist with rest of the asp.net web services. When I build service with VS 2005, Everything works great. I was able to generate proxy, build a client and make the communication between them happen.
Now when I added the project to source control and our builder started building the solution (of which WCF service is a part off), problems started surfacing.
1) First it threw an ASPNET Compiler error. I unchecked the pre-compiled site to be updatable, checked in the sln and the error got fixed in next build.
2) Now I am stuck with a new error. Our builder uses MSBuild. And when now when he or I build the sln with MSBuild, Build goes through fine but when I host the service in IIS and hit the url (e.g. http://localhost/serviceabc/serviceabc.svc") I see key/parameter null message. Basically an service activation exception. I do not see this if I am building using VS 2005.
Has anyone faced issues with hosting an WCF Service in IIS and building the solution with MSBuild?? Is there a solution?
All Replies
Sachin,
What is the exception being thrown during activation? What version of IIS are you using? What mode are you deploying your application - native mode or aspNetCompatabilityMode ?
thanks
-Ram
Hi Ram,
We are using IIS 6.0/ Windows 2003 OS. We get the below attached error in both Natvie/ aspNetCompatabilityMode as well.
Value cannot be null.
Parameter name: keyDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: key
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentNullException: Value cannot be null. Parameter name: key] System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) +41 System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +2634825 System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) +14 System.ServiceModel.Activation.MetabaseSettingsIis.GetTransportSettings(String virtualPath) +58 System.ServiceModel.Activation.MetabaseSettingsIis.GetAccessSslFlags(String virtualPath) +4 System.ServiceModel.Activation.HttpHostedTransportConfiguration.GetBaseAddresses(String virtualPath) +82 System.ServiceModel.Activation.HostedTransportConfigurationManager.InternalGetBaseAddresses(String virtualPath) +105 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +214 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +31 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +445 [ServiceActivationException: The service '/UpdateLabDoneQ/UpdateLabDoneQ.svc' cannot be activated due to an exception during compilation. The exception message is: Value cannot be null. Parameter name: key.] System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +962 System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) +419 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() +260 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() +760 System.ServiceModel.Activation.HostedHttpModuleRequestAsyncResult.BeginRequest() +178 System.ServiceModel.Activation.HttpModule.StartBeginProcessRequest(Object sender, EventArgs e, AsyncCallback cb, Object extraData) +70 System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +195 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
- Hi sachin2,
I have the same problem. Could you fix it? I know it has been a while, but please share your answer.


