Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Enabling DbDesignTimeResourceProviderFactory

$
0
0
Enabling DbDesignTimeResourceProviderFactory
West Wind Web Toolkit for ASP.NET
Enabling DbDesignTimeResourceProviderFactory
02/14/2012
07:12:15 AM
3FL0FFXF6 Show this entire thread in new window
Gratar Image based on email address
From:
To:
All 
Attachments:
None
Can't seem to enable the feature which writes local resources to the DB when the Visual Studio command: "Generate Local Resource" is run, which would be enormously helpful for our project.

I have been able to get DbResourceProvider working.

It seems that the statement:

[DesignTimeResourceProviderFactoryAttribute(typeof(DbDesignTimeResourceProviderFactory))]

should be all that's required for Studio to find the factory.

When I invoke Generate Local Resource on simple test page with a single test string (Label.Text), nothing happens. The edit symbol flashes on the test page filename and then dissapears. There's no resx entry or db entry and there's no meta:resourcekey added in the webform.

I realize design time code is tough to debug, since you need a 2nd instance of Studio to debug the instance that invokes the design time assembly. I don't think the design factory is being invoked at all, since log4net trace statements aren't even called in the ctor.

Am I missing something obvious?

FYI: Visual Studio 2010 Pro, .NET 4.0, Windows7

<UPDATE> Clue from Studio Output window:


Start creating resource content and adding 'meta' attributes to server controls and directives.
Inheritance security rules violated by type: 'Westwind.Globalization.DbDesignTimeResourceProviderFactory'. Derived types must either match the security accessibility of the base type or be less accessible.
Finished creating resource content and adding 'meta' attributes.

Microsoft blog suggests:
Can you try setting the following assembly level attribute to force .NET 2.0 security rules.
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]

Now, when I run Generate Local Resources I get:

Start creating resource content and adding 'meta' attributes to server controls and directives.
Object reference not set to an instance of an object.
Finished creating resource content and adding 'meta' attributes.

HTML Help Builder

Viewing all articles
Browse latest Browse all 10393

Trending Articles