473,769 Members | 6,799 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 3618
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
2872
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
9590
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
9424
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
10051
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...
1
10000
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5310
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
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.