473,403 Members | 2,338 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,403 software developers and data experts.

Compiling resources into assembly

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
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 CompileAssemblyFromSourceBatch-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
csCompilerParameters.CompilerOptions = "/res:form.resource", 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
CompileAssemblyFromSourceBatch 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

CompilerParameters csCompilerParameters = new
CompilerParameters(strLibraries, "ClientDownload.dll", true);

// Generate a dll

csCompilerParameters.GenerateExecutable = false;

// Set tempfilescollection

csCompilerParameters.TempFiles = csTempFiles;

// Compile library

csCompilerResults =
csCodeCompiler.CompileAssemblyFromSourceBatch(csCo mpilerParameters,
strCode );

return csCompilerResults;

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

"news.microsoft.com" <ne******@hotmail.com> wrote in message news:<#Q**************@TK2MSFTNGP10.phx.gbl>...
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
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 CompileAssemblyFromSourceBatch-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
csCompilerParameters.CompilerOptions = "/res:form.resource", 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
CompileAssemblyFromSourceBatch 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

CompilerParameters csCompilerParameters = new
CompilerParameters(strLibraries, "ClientDownload.dll", true);

// Generate a dll

csCompilerParameters.GenerateExecutable = false;

// Set tempfilescollection

csCompilerParameters.TempFiles = csTempFiles;

// Compile library

csCompilerResults =
csCodeCompiler.CompileAssemblyFromSourceBatch(csCo mpilerParameters,
strCode );

return csCompilerResults;

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********@hotmail.com> wrote in message
news:63**************************@posting.google.c om...
Just make them embedded Resources

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

news:<#Q**************@TK2MSFTNGP10.phx.gbl>...
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
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 CompileAssemblyFromSourceBatch-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 csCompilerParameters.CompilerOptions = "/res:form.resource", 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
CompileAssemblyFromSourceBatch 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

CompilerParameters csCompilerParameters = new
CompilerParameters(strLibraries, "ClientDownload.dll", true);

// Generate a dll

csCompilerParameters.GenerateExecutable = false;

// Set tempfilescollection

csCompilerParameters.TempFiles = csTempFiles;

// Compile library

csCompilerResults =
csCodeCompiler.CompileAssemblyFromSourceBatch(csCo mpilerParameters,
strCode );

return csCompilerResults;

Jul 21 '05 #3

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

Similar topics

0
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...
2
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...
1
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...
7
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...
0
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...
0
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...
2
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...
1
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...
1
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...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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...
0
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,...
0
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...

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.