Cannot perform add Service Reference on Client

Topics: July and December Releases Forum
Aug 27, 2007 at 10:52 AM
Hi,

I am running through the hands-on thingy for the v2 production version in C# (with WCF). At exercise 12 I'm sort of stuck since it refuses to run the 'Add Service Reference Recipe' on the client. I am using my codebase from the very early beginning but I decided to skip exercise 11. Is it in some way needed to perform exercise 12? It looks to me that it's sepparated :s I removed the app.config & Services directory as instructed. All the references are correct for as far as I can see. And right before I did this it still compiled perfectly. So what happened ... I'm guessing something is misconfigured but what and what caused it. I also restarted my PC so the port for the service might have changed but I doubt that makes a difference :s I can run the service and view the wsdl etc.

Here is what I get as output from the Microsoft Recipe Framework:

Output window created.
(*) Error: 0 : Microsoft.Practices.RecipeFramework.ValueProviderException: An exception occurred during the binding of reference or execution of recipe ConnectToWCFService. Error was: An error happened while calling the value provider or evaluating the default value of argument Configuration..
You can remove the reference to this recipe through the Guidance Package Manager. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Practices.RecipeFramework.Library.Configuration.Actions.GetConfigurationAction.get_Template()
at Microsoft.Practices.RecipeFramework.Library.Configuration.Actions.GetConfigurationAction.Execute()
at Microsoft.Practices.SoftwareFactories.ServiceFactory.Actions.Configuration.Helpers.ConfigurationVSHelper.AddNewConfiguration(Project project, IContainer action)
at Microsoft.Practices.SoftwareFactories.ServiceFactory.Actions.Configuration.GetConfigurationAction.Execute()
at Microsoft.Practices.SoftwareFactories.ServiceFactory.ValueProviders.ConfigurationProvider.OnBeginRecipe(Object currentValue, Object& newValue)
at Microsoft.Practices.RecipeFramework.Recipe.CallProviders(IDictionary providers, IDictionaryService readonlyArguments, IDictionaryService arguments, Boolean isBefore)
--- End of inner exception stack trace ---
at Microsoft.Practices.RecipeFramework.Recipe.CallProviders(IDictionary providers, IDictionaryService readonlyArguments, IDictionaryService arguments, Boolean isBefore)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(IAssetReference reference)
at Microsoft.Practices.RecipeFramework.RecipeReference.OnExecute()
at Microsoft.Practices.RecipeFramework.AssetReference.Execute()
at Microsoft.Practices.RecipeFramework.VisualStudio.RecipeMenuCommand.OnExec()
at Microsoft.Practices.RecipeFramework.VisualStudio.AssetMenuCommand.Invoke()
(*) Error: 0 : Microsoft.Practices.RecipeFramework.ValueProviderException: An exception occurred during the binding of reference or execution of recipe ConnectToWCFService. Error was: An error happened while calling the value provider or evaluating the default value of argument Configuration..
You can remove the reference to this recipe through the Guidance Package Manager. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Practices.RecipeFramework.Library.Configuration.Actions.GetConfigurationAction.get_Template()
at Microsoft.Practices.RecipeFramework.Library.Configuration.Actions.GetConfigurationAction.Execute()
at Microsoft.Practices.SoftwareFactories.ServiceFactory.Actions.Configuration.Helpers.ConfigurationVSHelper.AddNewConfiguration(Project project, IContainer action)
at Microsoft.Practices.SoftwareFactories.ServiceFactory.Actions.Configuration.GetConfigurationAction.Execute()
at Microsoft.Practices.SoftwareFactories.ServiceFactory.ValueProviders.ConfigurationProvider.OnBeginRecipe(Object currentValue, Object& newValue)
at Microsoft.Practices.RecipeFramework.Recipe.CallProviders(IDictionary providers, IDictionaryService readonlyArguments, IDictionaryService arguments, Boolean isBefore)
--- End of inner exception stack trace ---
at Microsoft.Practices.RecipeFramework.Recipe.CallProviders(IDictionary providers, IDictionaryService readonlyArguments, IDictionaryService arguments, Boolean isBefore)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(IAssetReference reference)
at Microsoft.Practices.RecipeFramework.RecipeReference.OnExecute()
at Microsoft.Practices.RecipeFramework.AssetReference.Execute()
at Microsoft.Practices.RecipeFramework.VisualStudio.RecipeMenuCommand.OnExec()
at Microsoft.Practices.RecipeFramework.VisualStudio.AssetMenuCommand.Invoke()
(*) Error: 0 : Microsoft.Practices.RecipeFramework.ValueProviderException: An exception occurred during the binding of reference or execution of recipe ConnectToWCFService. Error was: An error happened while calling the value provider or evaluating the default value of argument Configuration..
You can remove the reference to this recipe through the Guidance Package Manager. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Practices.RecipeFramework.Library.Configuration.Actions.GetConfigurationAction.get_Template()
at Microsoft.Practices.RecipeFramework.Library.Configuration.Actions.GetConfigurationAction.Execute()
at Microsoft.Practices.SoftwareFactories.ServiceFactory.Actions.Configuration.Helpers.ConfigurationVSHelper.AddNewConfiguration(Project project, IContainer action)
at Microsoft.Practices.SoftwareFactories.ServiceFactory.Actions.Configuration.GetConfigurationAction.Execute()
at Microsoft.Practices.SoftwareFactories.ServiceFactory.ValueProviders.ConfigurationProvider.OnBeginRecipe(Object currentValue, Object& newValue)
at Microsoft.Practices.RecipeFramework.Recipe.CallProviders(IDictionary providers, IDictionaryService readonlyArguments, IDictionaryService arguments, Boolean isBefore)
--- End of inner exception stack trace ---
at Microsoft.Practices.RecipeFramework.Recipe.CallProviders(IDictionary providers, IDictionaryService readonlyArguments, IDictionaryService arguments, Boolean isBefore)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(IAssetReference reference)
at Microsoft.Practices.RecipeFramework.RecipeReference.OnExecute()
at Microsoft.Practices.RecipeFramework.AssetReference.Execute()
at Microsoft.Practices.RecipeFramework.VisualStudio.RecipeMenuCommand.OnExec()
at Microsoft.Practices.RecipeFramework.VisualStudio.AssetMenuCommand.Invoke()
Reloading schema 'C:\Program Files\Microsoft Visual Studio 8\xml\Schemas\addinschema.xsd'.
Reloading schema 'C:\Program Files\Microsoft Visual Studio 8\xml\Schemas\adrotator.xsd'.
Reloading schema 'C:\Program Files\Microsoft Visual Studio 8\xml\Schemas\adrotator1_0.xsd'.
......... and on and on and on
Aug 27, 2007 at 1:20 PM
Figured it out ... apaarently the recepy doesn't realise that it can create a new App.config if there isn't one. Rather stupid that the hands-on tells you to delete the App.config file then lol :) Anyway, Glad it's working again.