.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Need help about resource file in another assembly...

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
Let's say that I have two project, one of them is my web application and the other one is my LIB project. I have some Resource files as Language.en-US.resx Language.es.resxIn my web application, I have added this LIB project as reference. I have some usercontrols.What I want is to use these LIB's resources file as usercontrols' controls' text.Let's say that I have a button like <asp:Button ID="btnSearch" runat="server" OnClientClick="ClearDetails();return true;" CssClass="button" Text="Search" OnClick="ButtonClicked">So how can I reflect the resources' file content to buttons' Text

View Complete Post

More Related Resource Links

Resource file and Assembly combination cause errors


I have an interesting issue. I first encountered it in Visual Studio 2010 Beta2 and am now able to replicate it in the release. The error occurred when i switched my company’s main application from 2008 to 2010. My quick fix at the time was to delete the form level resources and set any missing information from the resource in the form new. Recently, I encountered this issue in a much simpler application which lead me down this path.

The error reads "Could not load file or assembly '.../ClassLibrary1.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format." and points to my form's resource file.

After experimenting with all sorts of combinations of objects, files, and resources, I narrowed it down to the following circumstances.

  • On a 64-bit machine, create a 3.5 windows application.
  • Add an ImageList to the form and choose an image for the ImageList. It doesn't matter which image.
  • Create a 3.5 class library and make sure the first letter of the library's assembly name is less than 'S'. Ex. "ClassLibrary1"
  • Set the library's target cpu to x86
  • Add the library as a reference to the windows form.

These steps will produce the error at compile time. The library name just has to be before "System" on the reference list. When

set messageTemplateResourceName from resource file in Validation appication block.



  I am using Validation application block in my project and want to set validation message from resource file, but not able to do that. I tried giving the path of resource file in messageTemplateResourceType and name of resource in messageTemplateResourceName. But it did not help as I only receive the message if I have set something in messageTemplate even after setting the resource file.

Here is my code:

<validator lowerBound="1" lowerBoundType="Inclusive" upperBound="250"
              upperBoundType="Inclusive" negated="false" messageTemplate=""
              messageTemplateResourceType="Asurion.jCare.Common.Resources.UIResources.PerilTypeAndDetailsSection, Asurion.jCare.Common.Resources, Version=, Culture=neutral, PublicKeyToken=null"
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator, Microsoft.Practices.Enterpris

how to make a css style background image be linked to an image in the resource file


hey guy, i need help in a very troubling matter. I want to make a textbox with a specific style, within this style a set of images as background parts, how can i attach these images to the custom control as whenever i take the .dll file and add it to the toolbar the images do not appear. So i tried to make them as resource files and their property as embedded in .resx file, so how to make the css style background image url to be linked to any of those image.

thanks in advance

Page Title from Resource file...



I have Resource file...

I am using following code for Display Lable Text...

<asp:Label ID="lblName" runat="server" Text="<%$ Resources:resource,NAME %>"></asp:Label>

and I want to use that name for page title...

so I used "me.page.resources.resource.NAME" in code behind page.

 but I want to use that NAME in

<%@ Page Language="VB"

Problem in accessing resource file dynamically.


Steps I have followed are
1.I have created myres.en-GB.resx file at C:.
2.then created locale specific myres.en-GB.resources using resgen at c: only,
resgen c:\myres.en-GB.resx
3.Linked the Resource File to Assembly using AL.exe which is giving me assembly at c: only.
Al /t:lib /embed:myres.en-GB.resources /out:ClassLibrary1.dll
4.I have created one web application using vs 2008 & then build it.
5.Then placed both resource file & dll in web applications Bin\en-GB folder.
6.Anf finally written code at page load like
 CultureInfo info = new CultureInfo("en-GB");
            Thread.CurrentThread.CurrentCulture = info;
            Assembly asd = Assembly.Load("ClassLibrary1");
            ResourceManager res = new ResourceManager("myres.en-GB", asd.GetSatelliteAssembly(info));
            string sdf = res.GetString("Lab1");

but after running application I m getting following error
MissingManifestResourceException", "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Cla

Could not load file or assembly - Web Deployment Project



I have the following projects in a solution :

- A Web Application

- A Class Library

- A Web Deployment project

The Web Application compiles and run fine when I don't go through the Web Deployment Project. However when I try to use that, I get the following error:

Error 1 An error occurred creating the configuration section handler for hibernate-configuration: Could not load file or assembly 'NHibernate' or one of its dependencies. The system cannot find the file specified. (F:\Folke\Folke.csproj_deploy\Release\web.config line 4) 1 1 Folke.csproj_deploy

"An error occurred creating the configuration section handler for hibernate-configuration: Could not load file or assembly 'NHibernate' or one of its dependencies. The system cannot find the file specified. (F:\Folke\Folke.csproj_deploy\Release\web.config line 4)"

This is the beginning of my Web.config:


Resource File: Blogging Tools


Resource File: Microsoft Newsgroups for Developers


Microsoft offers more than 1,900 public and 500 private newsgroups that cover all aspects of Microsoft products and technologies. An individual newsgroup might get up to 15,000 postings per month, with developers answering customer questions, asking about specific product features, and getting product feedback.

MSDN Magazine May 2004

Resource File: Microsoft Virtual Machine Remediation


Developers who use the Microsoft virtual machine (VM) will need to transition away from its use by January 2004. To comply with a court settlement with Sun Microsystems, Microsoft will not be able to update the Microsoft VM, even to repair critical security vulnerabilities.

MSDN Magazine September 2003

Resource File: Creating Privacy-aware Web Sites


Privacy issues are of primary concern to those involved in Internet commerce. Some consumers are hesitant to provide information to Web sites without clearly understanding how their data will be used and with whom it will be shared.

MSDN Magazine August 2003

Resource File: MSDN Online Developer Centers


When you're looking for information about a specific technology, don't you wish you could rely on one site to point you to the most pertinent content? Now you can. Based on feedback from software developers, MSDN Online has centralized all developer information on specific technologies so you don't have to hunt in several locations.

MSDN Magazine June 2003

Resource File: Windows Media 9 Series Digital Rights Management


If you have an application that handles Windows Media content and you need an effective way to track content usage, Windows Media 9 Series now offers Digital Rights Management (DRM). It allows you to take advantage of the peer-to-peer distribution model and still redirect users back to your app once they have downloaded your content (prior to viewing).

MSDN Magazine May 2003

Resource File: ASP.NET Starter Kits


It's a well-known axiom in the world of programming: build the samples and they will come. ASP. NET is well suited for building online storefronts and communities, but a lack of easy-to-use, standardized samples has sometimes slowed adoption.

MSDN Magazine April 2003

Resource File: Technical Support Options


Development can have its frustrating moments. How many times have you been in the middle of a project and encountered a problem you just couldn't solve alone? In order to help you through this, Microsoft provides quite a wide variety of support options from Web-based chats and newsgroups to paid premier customer support.

MSDN Magazine February 2003

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend