Tuesday, November 23, 2010

Microsoft.Practices.Repository : Make sure "GenericResources.resources" was correctly embedded or linked into assembly

Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "GenericResources.resources" was correctly embedded or linked into assembly "Microsoft.Practices.Repository" at compile time, or that all the satellite assemblies required are loadable and fully signed.

This was the error which held my neck for more than two days. We follow Repository Factory for Visual Studio 2008 for Data Access Layer Creation (By Microsoft Patterns and Practices.)


I replaced the ExceptionHandling snippet [throw new RepositoryFailureException(ex);]
with [throw new RepositoryFailureException(ex.Message,ex.InnerException);] in each repository class generated by Repository Factory.

Did a Find and Replace for the whole DataAccess Project. Then went for a build of all the projects (DataAccess Layer, Business Logic Layer, and Presentation Layer. Then Ran the solution by Setting Startup Page as Finance User Dashboard.

Error got changed to the following.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

This is a very familiar one. Could be some thing wrong either with the Connection String in the Web.config or Failed network connection. :) the parameters mentioned in the Web.Config was pointing a wrong DB.

See, how vague the initial error was. It didnt have any relation with the actual problem. Be aware of these situations, these can mess up your day.

2 comments:

Anonymous said...

Hi sir,

Your posts are very useful. Please keep on posting useful article in coming day.

Placement Training In Chennai said...

wow very interesting blog I like it very much I good read like blog

Ieee Embedded Projects