473,785 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compiling resources into assembly

Hi!

My app consists of three parts:
1. Client app
2. A webservice with sourcecodefunct ions
3. Local "end-user-compiled library"

The user does like this:
1. Download small app from Internet
2. Start application and login to my service
3. Small app downloads source code and compiles an assembly for it to use

So far so good. Everything works fine as long as I don't need any extra
resources.

For example: A Form with any Windows Forms control on it works fine. A form
containg icons or an ImageList with icons doesn't work since I have to
compile the resource into the assembly.

I use the CompileAssembly FromSourceBatch-function to create my assembly. I
read somewhere that .resx-files could be entered in the string [] as a part
of the code to compile but it doesn't work.

My problem is that I don't have physical resx-files. Only as string from my
service and I really dont want to create any files locally on the client
computer. I know that I can use resgen to make .resource-files and then add
csCompilerParam eters.CompilerO ptions = "/res:form.resour ce", but since I
don't want to create files it's not an option either.

In other words... how do I create my assembly using
CompileAssembly FromSourceBatch including my resx-files!!!

Regards Kristian

Here's how I do it. Pretty straight forward isn't it?
// Create compiler
csCodeCompiler = csCodeProvider. CreateCompiler( );

// Add references

CompilerParamet ers csCompilerParam eters = new
CompilerParamet ers(strLibrarie s, "ClientDownload .dll", true);

// Generate a dll

csCompilerParam eters.GenerateE xecutable = false;

// Set tempfilescollec tion

csCompilerParam eters.TempFiles = csTempFiles;

// Compile library

csCompilerResul ts =
csCodeCompiler. CompileAssembly FromSourceBatch (csCompilerPara meters,
strCode );

return csCompilerResul ts;

Jul 21 '05 #1
2 3620
Tom
Just make them embedded Resources

"news.microsoft .com" <ne******@hotma il.com> wrote in message news:<#Q******* *******@TK2MSFT NGP10.phx.gbl>. ..
Hi!

My app consists of three parts:
1. Client app
2. A webservice with sourcecodefunct ions
3. Local "end-user-compiled library"

The user does like this:
1. Download small app from Internet
2. Start application and login to my service
3. Small app downloads source code and compiles an assembly for it to use

So far so good. Everything works fine as long as I don't need any extra
resources.

For example: A Form with any Windows Forms control on it works fine. A form
containg icons or an ImageList with icons doesn't work since I have to
compile the resource into the assembly.

I use the CompileAssembly FromSourceBatch-function to create my assembly. I
read somewhere that .resx-files could be entered in the string [] as a part
of the code to compile but it doesn't work.

My problem is that I don't have physical resx-files. Only as string from my
service and I really dont want to create any files locally on the client
computer. I know that I can use resgen to make .resource-files and then add
csCompilerParam eters.CompilerO ptions = "/res:form.resour ce", but since I
don't want to create files it's not an option either.

In other words... how do I create my assembly using
CompileAssembly FromSourceBatch including my resx-files!!!

Regards Kristian

Here's how I do it. Pretty straight forward isn't it?
// Create compiler
csCodeCompiler = csCodeProvider. CreateCompiler( );

// Add references

CompilerParamet ers csCompilerParam eters = new
CompilerParamet ers(strLibrarie s, "ClientDownload .dll", true);

// Generate a dll

csCompilerParam eters.GenerateE xecutable = false;

// Set tempfilescollec tion

csCompilerParam eters.TempFiles = csTempFiles;

// Compile library

csCompilerResul ts =
csCodeCompiler. CompileAssembly FromSourceBatch (csCompilerPara meters,
strCode );

return csCompilerResul ts;

Jul 21 '05 #2
Hi!

Ok... I had that figured out, but I don't know how to do it.

Do I have to make resource-files instead of resx-files? Tried that but I got
compilation error.

Kristian

"Tom" <ju********@hot mail.com> wrote in message
news:63******** *************** ***@posting.goo gle.com...
Just make them embedded Resources

"news.microsoft .com" <ne******@hotma il.com> wrote in message

news:<#Q******* *******@TK2MSFT NGP10.phx.gbl>. ..
Hi!

My app consists of three parts:
1. Client app
2. A webservice with sourcecodefunct ions
3. Local "end-user-compiled library"

The user does like this:
1. Download small app from Internet
2. Start application and login to my service
3. Small app downloads source code and compiles an assembly for it to use
So far so good. Everything works fine as long as I don't need any extra
resources.

For example: A Form with any Windows Forms control on it works fine. A form containg icons or an ImageList with icons doesn't work since I have to
compile the resource into the assembly.

I use the CompileAssembly FromSourceBatch-function to create my assembly. I read somewhere that .resx-files could be entered in the string [] as a part of the code to compile but it doesn't work.

My problem is that I don't have physical resx-files. Only as string from my service and I really dont want to create any files locally on the client
computer. I know that I can use resgen to make .resource-files and then add csCompilerParam eters.CompilerO ptions = "/res:form.resour ce", but since I
don't want to create files it's not an option either.

In other words... how do I create my assembly using
CompileAssembly FromSourceBatch including my resx-files!!!

Regards Kristian

Here's how I do it. Pretty straight forward isn't it?
// Create compiler
csCodeCompiler = csCodeProvider. CreateCompiler( );

// Add references

CompilerParamet ers csCompilerParam eters = new
CompilerParamet ers(strLibrarie s, "ClientDownload .dll", true);

// Generate a dll

csCompilerParam eters.GenerateE xecutable = false;

// Set tempfilescollec tion

csCompilerParam eters.TempFiles = csTempFiles;

// Compile library

csCompilerResul ts =
csCodeCompiler. CompileAssembly FromSourceBatch (csCompilerPara meters,
strCode );

return csCompilerResul ts;

Jul 21 '05 #3

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

Similar topics

0
1412
by: Henke | last post by:
Hi! I'm writing an app supporting different languages. I store error messages in a string resource files for each language. The resource files are added to the project. My problem is that I have to use the assembly linker (AL) to link my string resources to the app.resources.dll file. Can't this be done automaticly when compiling the application in Visual studio 2003? Thanks in advance!
2
1628
by: KoolistOne | last post by:
I have a template that I would like to include a namespace in but I won't be using that referenced namespace til a few months from now. In the mean time, will that referenced, but not used/called namespace consume any resources? The template is going to be used by many people who will modify it to their use now, later when we roll out a new feature which will consume that namespace, they will 1. be set to go if we include the reference to...
1
2874
by: Derick Smith | last post by:
Hi! I am just starting to use .NET and need some help! If I create my own DLL for String resouces using this command: C:\WINNT\MICROS~1.NET\Framework\v1.1.4322\Al /t:lib /embed:resourceString.fr-ca.resources, /culture:fr-ca /out:Example2.resources.dll C:\WINNT\MICROS~1.NET\Framework\v1.1.4322\Al /t:lib /embed:resourceString.resources, /out:Example2.resources.dll
7
1757
by: Ken Allen | last post by:
OK, for a number of reasons I have needed to begin experimenting with resources sooner than I had planned (I had avoided it for now). Step 1: I built the 'reseditor' application that is in the SDK sub-directory, as instructed by the MSDN. Step 2: I used the 'reseditor' to create a file named "MyResources.resources" that contains only some string resources. Step 3: I added this resource file to my existing test assembly (does not do
0
1456
by: Louise Caldicott | last post by:
Hi all, I have created a project in Visual Studio which uses satellite assemblies. I have also written a script to build this project from the command line. There seems to be a difference in behaviour when I link the resources via Dev Studio and the command line.
0
2199
by: Johann Blake | last post by:
I'm having trouble grasping how ASP.NET correctly locates resources. There is plenty of documentation on this subject but some things are not clear at all. In my ASP.NET application, I have multiple web forms. When you compile the application, it creates a DLL. If you view this DLL using ILDASM (the manifest), it shows info about the resources stored in the DLL. There is essentially an embedded resource "section" for each web form. The...
2
333
by: news.microsoft.com | last post by:
Hi! My app consists of three parts: 1. Client app 2. A webservice with sourcecodefunctions 3. Local "end-user-compiled library" The user does like this: 1. Download small app from Internet 2. Start application and login to my service
1
3208
by: spencermiles | last post by:
Hello, I'm working on a large solution, comprised on numerous Projects, and I would like to have one central projects that contains a set of global RESX Resources. It doesn't make sense to have various resources (strings, images, etc...) scattered through the application; having them all in one central area will be a huge boon. The problem that I'm running into is being able to access these resources from external assemblies. I have...
1
2908
by: dkunha | last post by:
I have an resources only assembly. string1 = Resources.Resource1.String1 string2 = Resources.Resource1.String2 image1 = Resources.Resource1.Image1 But using this assembly in another project I can't get to them because these properties are private.
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10148
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.