Data Access - Receipe Framework Error

Topics: General Discussion Forum
May 15, 2007 at 2:22 PM
I get a receipe error with the following Service Factory (Data Access) receipes,:
Add New Database Connection
Create CRUD Stored procedures

This happens with a WCF or ASMX WSSF new project.

CRUD
Microsoft.Practices.RecipeFramework.ValueProviderException: An exception occurred during the binding of reference or execution of recipe CreateCRUDSp. Error was: Failed to load value providers..
You can remove the reference to this recipe through the Guidance Package Manager. ---> System.TypeLoadException: Microsoft.Practices.ServiceFactory.DataAccess.ValueProviders.VisualStudio.ConfigurationItemProvider, Microsoft.Practices.ServiceFactory.DataAccess ---> System.IO.DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Microsoft.Practices.Common.Services.TypeResolutionService.GetAssembly(AssemblyName assemblyName, Boolean throwOnError)
at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
--- End of inner exception stack trace ---
at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.Practices.Common.Services.AliasResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError)
at Microsoft.Practices.RecipeFramework.Recipe.GetInstanceT(ITypeResolutionService resolution, String concreteType)
at Microsoft.Practices.RecipeFramework.Recipe.LoadProviders(ITypeResolutionService resolution)
--- End of inner exception stack trace ---
at Microsoft.Practices.RecipeFramework.Recipe.LoadProviders(ITypeResolutionService resolution)
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()

Database connection

System.TypeLoadException: Microsoft.Practices.ServiceFactory.DataAccess.Converters.ConnectionNameConverter, Microsoft.Practices.ServiceFactory.DataAccess ---> System.IO.DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Microsoft.Practices.Common.Services.TypeResolutionService.GetAssembly(AssemblyName assemblyName, Boolean throwOnError)
at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
--- End of inner exception stack trace ---
at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.Practices.Common.Services.AliasResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError)
at Microsoft.Practices.RecipeFramework.GuidancePackage.CreateAndConfigureConverter(Argument argument, ITypeResolutionService resolution, TypeConverter converter)
at Microsoft.Practices.RecipeFramework.GuidancePackage.EnsureInitializeMetadataForCurrentRecipe()
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()

In the Host web project I have a web.config and Microsoft.Practices.RecipeFramework.Library.dll file in the ASMX and DataAccess directories as recommended on the known issues.

I have the following installed:

Visual Studio 2005 SP1
Visual Studio 2005 SDK
SQL Server Express 2005
Guidenance Automation Extensions Feb 2007 Download version 1.0.51104
GAT Feb 07 Download version 1.0.51104
Enterprise Library 3.0 Apr 07
Web Service Software Factory Dec 06 Version 2.0
Web Client Software Factory Jan 07 Version 1.0

Any ideas how to fix this problem?

Thanks
May 15, 2007 at 4:23 PM
Try checking the registry entry that set the path to the EntLib binaries.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\patterns and practices\Service Factory\EntlibBinaryPath
This should point to your "\bin" folder of your EntLib installation path where you have all the binaries.

Charly
May 15, 2007 at 9:31 PM
Thanks, it sorted out my problem.

However now that I have run through all the receipe's and tried to run the application I get the following my web browser, any ideas?
I have the assembly installed in my GAC, even if I do a simple web service I get the same problem.

Thanks,
Gavin

The system cannot find the path specified. (Exception from HRESULT: 0x80070003)
Description: 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.IO.DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)

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:


DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)

FileNotFoundException: Could not load file or assembly 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the path specified.

FileNotFoundException: Could not load file or assembly 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the path specified.
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32

ConfigurationErrorsException: Could not load file or assembly 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the path specified.
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +3487289
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +180
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +347
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125
System.Web.Compilation.BuildManager.CompileCodeDirectories() +525
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +448

HttpException (0x80004005): Could not load file or assembly 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the path specified.
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

HttpException (0x80004005): Could not load file or assembly 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the path specified.
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434991
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252
May 15, 2007 at 10:09 PM
It seems that in one of your libraries you have a reference to "System.EnterpriseServices".
You may verify that you have that reference in your web project and that should fix this.
May 16, 2007 at 8:35 AM
I have a reference in my project to System.EnterpriseServices as it wouldn't compile without it.

I also have the following in my web.config:

<assemblies>
<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>

What I have noticed in my .NET 2 config is that System.Enterprise services is not in the GAC Cache it is in the ZAP Cache instead.

I have tried restarting IIS, my machine, emptying vswebcache, checked the .NET config. Could it be something like my machine.config?

Thanks,
May 16, 2007 at 11:14 AM
Try moving System.EnterpriseServices to the GAC Cache, where it should be in a default installation.
May 16, 2007 at 4:16 PM

charlyfriend wrote:
Try moving System.EnterpriseServices to the GAC Cache, where it should be in a default installation.


Thanks,
that fixed it too:)