473,395 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Using Resource Files - not for localization

I would like to use compiled resource files in my web application that are
not related to localization.
The idea is to have a dll with resources that can be accessed by the
website.

I have no problem making the dll.
I am running into problems using it.

I am attempting to use the resource manager to get the values from the dll
and update the controls appropriately.

When I try to use it, I get a MissingManifestResourceException error saying
Could not find any resources appropriate for the specified culture (or the
neutral culture) on disk.

How can I avoid this?

Thanks,
Bill Mell
Jul 24 '07 #1
1 1980
Bill,

Not sure of your setup and why you get those errors.
I can tell you the way I use resources - see whether it works for you.
- In your dll set BuildAction for the files to "Embedded Resource"
- inside your dll define a function that would return the resource,
something similar to the following:
using System;
using System.IO;
using System.Reflection;
....
public class MyDllClass{
....
private static Assembly _asm = Assembly.GetExecutingAssembly();
private static Type _localType = typeof(MyDllClass);
....
public static Stream GetResource(string location, string name)
{
return _asm.GetManifestResourceStream(_localType, location + "." + name);
}

if your resource files are grouped in a folder - you would specify the
folder name in location parameter, otherwise pass empty string. Note that
resource name is case-sensitive.

If you program in VB, I believe that you do not specify the location - it
does not create a namespace for folders.

To get a string from your Stream, use
new StreamReader(stream).ReadToEnd();

Hope this helps

"Bill Mell" wrote:
I would like to use compiled resource files in my web application that are
not related to localization.
The idea is to have a dll with resources that can be accessed by the
website.

I have no problem making the dll.
I am running into problems using it.

I am attempting to use the resource manager to get the values from the dll
and update the controls appropriately.

When I try to use it, I get a MissingManifestResourceException error saying
Could not find any resources appropriate for the specified culture (or the
neutral culture) on disk.

How can I avoid this?

Thanks,
Bill Mell
Jul 25 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bill | last post by:
Hi Everyone, I am having some difficulty in using the Windows Resource Localization Editor (WinRes.exe) on several Visual Basic .NET forms (.resx files) in two different projects. The editor...
0
by: gen | last post by:
Hi everybody, We would like to use localization in order to translate our applications. The working environment of the users is very bilingual so they often have to switch from one language to...
0
by: Maileen | last post by:
Hi, I use the localization feature of my VB.net application to create some ApplicationName.resource.dll files, but i would like to know if it does not exist a way to change the name of these...
0
by: vivek | last post by:
localization of lang. using resource files resides in the global resources folder (App_GlobalResources). Currently In my application, I need to have different language resource files in global...
1
by: chandu | last post by:
hello, i am developing a globalized application.for that i need to create some resource files for localization. i created resource file for english. now i want to convert the english resource...
2
by: craigkenisston | last post by:
I'm starting to work in an application that will be freely distribuited to the community. This means, people from any country will use it application has been created taking in consideration that...
1
by: Claire | last post by:
Im writing a small application to allow some none techy people create localized string resources for our main application. So we can reuse modules each one has its own .resx resource file. So my...
8
by: Tomasz J | last post by:
Hello Developers, It may sound like a stupid question, but how to embed a resource in ASP.Net 2.0 web application? I mean, without using a separate library. There is no "build action" property....
3
by: hsmit.home | last post by:
I spent way too much time on this and I must say, I was a little disgruntled with what has been posted on all the various Xalan C mailing lists. Everyone says there's a solution, but give next to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.