DAAB not picking up connectionstring in Design Time

Apr 8, 2009 at 3:38 PM
Hello all:

I've been using enterprise library DAAB for a long time. Recently, I have a project where a class is a Visual Studio "Design Time" class  (a custom resource provider that implements
where it use Tool->Generate local Resource in Visual Studio at "Design Time" to generate resource key to data store.  The project itself is a class library but is used and referenced within a web application where <connectionstring> is defined in web.config

In it, I did

Database db = DatabaseFactory.CreateDatabase("MyConnectionString");

If I use a similar class at RUN TIME, then DAAB picks up the "MyConnectionString" from web.config when the application runs. It's fine.

But during design time, when I used "Tools-Generate Local Resource",  DAAB simply doesn't know where "MyConnectionString" is.

How do I resolve this issue?

Below is a snippet of my class

public sealed class GlobalizationDesignTimeResourceProviderFactory : DesignTimeResourceProviderFactory
        private IResourceProvider _localResourceProvider;

        public GlobalizationDesignTimeResourceProviderFactory()
            Database db = DatabaseFactory.CreateDatabase("MyConnectionString");
  } public override IResourceProvider CreateDesignTimeGlobalResourceProvider(IServiceProvider serviceProvider, string applicationKey) { return new GlobalizationDesignTimeGlobalResourceProvider(applicationKey); } ............. }

Please advice, greatly appreciate it.

Apr 13, 2009 at 11:10 AM

Do you get any exception? What exception is it?

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.