asp.net - Localization of Custom Controls in a redistributable assembly -
i'm trying build redistributable assembly containing several custom controls (commoncontrols). my environment: msvc 2010, asp.net (webforms) .net 2.0/3.0/3.5
the problem: compiling web deployment project won't work if localize commoncontrols via app_globalresources.
here how build commoncontrols assembly:
i use website containing .ascx , .ascx.cs files:
and web deployment project following settings:
this create "commoncontrols.dll". assembly used in different asp.net webapplication follows:
web.config:
first (minor) problem: adding commoncontrols dependency not automatically copy satellite assemblies languages. copying them manually correct output path seems work though (for debugging).
main problem: main web application localized via app_globalresources , built web deployment project:
that build process fail with
aspnetcompiler : error aspruntime: object reference not set instance of object.
both deployment projects create file named "bin\app_globalresources.compiled" , guess 2 files cannot coexist peacefully within same output-project.
is there elegant solution localize both commoncontols , main using asp.net built-in localization?
note: project i'm working on has compatible apache+mono, project-settings (screenshots above) must work correctly (already tested other variations).
i fixed it. (probably) caused outdated assemblies in bin folder used wdp (seems idea manually clean folder time time).
i copied files "commoncontrols\bin" final output (via pre-build event) not necessary , causes break (satellite assemblies translations automatically copied msvc).
while problem+solution might not helpful others, it's @ least tutorial how build re-distributable assembly custom-controls out of bunch of user-controls.
notes:
- all outputs of custom-control assembly must merged. otherwise end 2 "app_globalresources.dll" files (won't work)
- it works "web-site project", not "web application"
- user-controls must use "codefile/inherit" tags, not deprecated "codebehind" tag (get rid of ".designer.cs" files!)
- user-controls must have "classname" tag differs control's name (i appended "internal" , renamed class(es) in code-behind)
- embedded resources (images, scripts...) not directly supported in "web-site project". use additional lib that
Comments
Post a Comment