473,406 Members | 2,705 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,406 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;
Nov 16 '05 #1
1 3663
Why not create temporaray files and then delete them when you are done?
It should be a fairly simple operation to perform.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"news.microsoft.com" <ne******@hotmail.com> wrote in message
news:uF**************@tk2msftngp13.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;

Nov 16 '05 #2

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...
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: 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: Ajoy Kumar | last post by:
Hi, Firstly, I have created an Assembly with RlinkPMBAPIRes.dll Secondly, I have created an Assembly with TestRes.exe which is the calling application. 1. RlinkPMBAPIRes RlinkPMBAPIRes...
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...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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
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
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.