473,412 Members | 4,127 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,412 software developers and data experts.

How to save a DLL created by the AssemblyBuilder to a specific directory

I'm using some sample code from the msdn sample project:
http://download.microsoft.com/downlo...onEmit.zip.exe

I'm using the 'AssemblyBuilder.Save' method, however, it takes a file name
as a parameter and I dont see any documentaion on how to define the
path/target location to write the file to. Here's a snippet of my code:

Dim TCA As New TestCreateAssembly
Dim [assembly] As AssemblyBuilder
[assembly] = CType(TCA.CreateCallee(Thread.GetDomain(),
AssemblyBuilderAccess.Save).Assembly, AssemblyBuilder)
[assembly].Save("EmittedAssembly.dll")

How do I determin exactly where to write "EmittedAssembly.dll" to?

Thanks.
--
mo*******@nospam.nospam
Dec 21 '05 #1
3 13134
Hi moondaddy,

Here is an example on how to use AssemblyBuilder.Save to save the dynamic
to disk.

http://msdn2.microsoft.com/en-us/library/8zwdfdeh.aspx

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Dec 21 '05 #2
Thanks.
I looked through the sample but didn't see where you could specify a
particular directory to save the dll into. I already have code that saves
the dll to disk, but it writes it into the same directory where the other
assembly dlls are. I want to specify a completely different directory which
could be on a different drive.

--
mo*******@nospam.nospam
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:pS****************@TK2MSFTNGXA02.phx.gbl...
Hi moondaddy,

Here is an example on how to use AssemblyBuilder.Save to save the dynamic
to disk.

http://msdn2.microsoft.com/en-us/library/8zwdfdeh.aspx

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Dec 22 '05 #3
Hi moondaddy,

The DefineDynamicAssembly method is overloaded. You can specify the path.
For example, you can use the following to create the AssemblyBuilder. The
dll will be written to c:\

Dim a As AssemblyBuilder =
Thread.GetDomain().DefineDynamicAssembly(New AssemblyName("aaa"),
AssemblyBuilderAccess.RunAndSave, "c:\")

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Dec 22 '05 #4

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

Similar topics

5
by: Bill H | last post by:
I thought that moving the session files would be as simple as changing session.save_path = /tmp to some other directory. Is there more that is required? I pointed at /sess but the directory...
2
by: Jax | last post by:
I'm having difficulty with creating dynamic types, TypeBuilder is attained through module builder which in turn comes from assembly builder. I assumed that if you save the assembly you'd save the...
9
by: Ivan Demkovitch | last post by:
Hi! I would like to know if I can save File on Server using server-side code? For example, I like to create thumbnail images and populate specific directory. Do I need specific permissions...
1
by: Alan T | last post by:
I want to open a blank Word document. Once the user click the save button, it will be saved to a specific directory. How can I do that?
3
by: Koliber (js) | last post by:
sorry for my bad english when I fire up (from my c# code) a standard "file - save as " dialog, and when chosen location is a shered local network directory, where I do have rights to create...
13
by: NJonge01 | last post by:
I use this "Access Cookbook" from Ken Getz that comes with some pretty nice sample code and applications. I use some file open features they have but I don't know enough about what they've created...
1
by: Michael Sander | last post by:
Hello ng, anyone knowns how to add a reference to an assembly to System.Reflection.AssemblyBuilder? In System.Web.Compilation.AssemblyBuilder is a function like AddAssemblyReference, but not in...
9
by: Michael Sander | last post by:
Hello ng, anyone knowns how to add a reference to an assembly to System.Reflection.AssemblyBuilder? In System.Web.Compilation.AssemblyBuilder is a function like AddAssemblyReference, but not in...
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
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
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
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...
0
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...

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.