473,503 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

file not found error with C# dll

i have written a C# class library dll. it compiles fine, and i copy the
resulting output file (mylibrary.dll) from the Visual Studio debug
folder to another folder on the same machine ("c:\libraries")

then i go into the COM+ MMC and add a new COM+ application
("myapplication") and add new components to that application. now this
is the key: i add the components from the file located at
"c:\libraries\mylibrary.dll"

i launch the application that uses this library, and everything works
fine. HOWEVER, the error comes up when i do the following:

1. change the library and recompile it in VS
2. disable and shut down the COM+ application
3. MOVE the dll file from the VS debug folder to "libraries" folder
4. re-enable and start the COM+ application

now all of a sudden the application using the library reports a file
not found error, because the .dll file isn't in the DEBUG folder.
however, i registered the dll with COM+ from the LIBRARIES folder. why
on earth would it go looking for it in the debug folder??

thanks for any help

jason

Nov 17 '05 #1
10 6485
I am not sure about your project settings, you need to check the post build
events whether the registration script is there. By default, Visual Studio
will generate registration script which calls regsvr32 to register the COM
dll in output folder whenever your re-compile your project. The place you
need to look at is in project settings dialog, build events tab.

"jason" <ia****@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
i have written a C# class library dll. it compiles fine, and i copy the
resulting output file (mylibrary.dll) from the Visual Studio debug
folder to another folder on the same machine ("c:\libraries")

then i go into the COM+ MMC and add a new COM+ application
("myapplication") and add new components to that application. now this
is the key: i add the components from the file located at
"c:\libraries\mylibrary.dll"

i launch the application that uses this library, and everything works
fine. HOWEVER, the error comes up when i do the following:

1. change the library and recompile it in VS
2. disable and shut down the COM+ application
3. MOVE the dll file from the VS debug folder to "libraries" folder
4. re-enable and start the COM+ application

now all of a sudden the application using the library reports a file
not found error, because the .dll file isn't in the DEBUG folder.
however, i registered the dll with COM+ from the LIBRARIES folder. why
on earth would it go looking for it in the debug folder??

thanks for any help

jason


Nov 17 '05 #2
that's exactly what it seems like it's doing. it seems like it is
registering the dll when i perform a build, so thank you for this
useful lead.

however, when i go into the project properties, the common properties
folder, build events settings have both the pre-build and post-build
event command line settings blank. it does say "run the post-build
event?" set to "on successful build"

in the configuration properties folder, build settings, the only thing
that seems to reference registration is "register for com interop"
which is set to true, but that doesn't actually register the dll does
it? i thought it just wrapped it for com style calls.

thanks again,

jason

Nov 17 '05 #3
It is post-build events, and I am almost pretty much sure that this is the
reason for your problem. COM+ cannot work with managed code directly at
current time, it needs interop to call managed code. You can remove the self
registration script from post build events safely. Normally they are only
useful when you changed the inerface.

"jason" <ia****@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
that's exactly what it seems like it's doing. it seems like it is
registering the dll when i perform a build, so thank you for this
useful lead.

however, when i go into the project properties, the common properties
folder, build events settings have both the pre-build and post-build
event command line settings blank. it does say "run the post-build
event?" set to "on successful build"

in the configuration properties folder, build settings, the only thing
that seems to reference registration is "register for com interop"
which is set to true, but that doesn't actually register the dll does
it? i thought it just wrapped it for com style calls.

thanks again,

jason


Nov 17 '05 #4
yeah, it seems like it would be the cause. so i suppose my last
question is "how do i remove the post-build event script?"

the only three options listed under "Run the Post-Build Event?" setting
are "Always," "On successful build," and "Only when the build updates
the project output file."

i don't see an option for "Never." so how can i remove the self
registration script? thanks!

jason

Nov 17 '05 #5
Is it possible to just remove the command from the Post Build Event Command
Line? You can just remove the command that calls registor.

"jason" <ia****@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
yeah, it seems like it would be the cause. so i suppose my last
question is "how do i remove the post-build event script?"

the only three options listed under "Run the Post-Build Event?" setting
are "Always," "On successful build," and "Only when the build updates
the project output file."

i don't see an option for "Never." so how can i remove the self
registration script? thanks!

jason


Nov 17 '05 #6
that's just it, the Post-Build Event Command line settings are empty.
there are no command lines set. is it possible some other setting is
causing the automatic registration?

Nov 17 '05 #7
Do you have anything from the build log of the Visual Studio? It logs all
operations in the build log file.

"jason" <ia****@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
that's just it, the Post-Build Event Command line settings are empty.
there are no command lines set. is it possible some other setting is
causing the automatic registration?


Nov 17 '05 #8
not to ask a silly question, but how do i activate/view the build log?
i can't find any reference to the build log in the visual studio help
articles, except for VC++ projects.

Nov 17 '05 #9
Sorry, I didn't notice that C# projects do not have build log file. This is
out of my kowledge now. I got similiar problem two years ago which we were
using a seperate proxy/stub dll for the COM+ component and the registration
of the proxy/stub dll causes a lot of problems.

"jason" <ia****@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
not to ask a silly question, but how do i activate/view the build log?
i can't find any reference to the build log in the visual studio help
articles, except for VC++ projects.


Nov 17 '05 #10
no problem, thanks for the help

Nov 17 '05 #11

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

Similar topics

6
16598
by: o'seally | last post by:
solaris/linux admins/rookie_developers that battle with this error are probably all frustrated when it happens. i bet you're also somehow frustrated by this seemingly unsolvable error :-) ...take...
1
14339
by: Michelle Hillard | last post by:
Hi guys, would appreciate if you can shed some light on this. Sorry to be a pain, can you tell me what is wrong with the following: for /F %%i in ('dir /b /on c:\bcp\pc*.txt') do bcp...
11
2571
by: mkarja | last post by:
Hi, I'm trying to figure out how to read some range of rows from a file. Is it possible to search the file with some criteria and then when the search string is found read 3 rows before and...
3
12159
by: Michael Bøcker-Larsen | last post by:
Hi I'v been stuck on this problem for ages now. I have found that I'm not the only one with this problem, by looking through the different newsgroups. Hope you can help me! I know there is a...
7
13362
by: Mark | last post by:
Hello, I have researched and tried every thing I have found on the web, in groups and MS KB articles. Here is what I have. I have a Windows 2000 Domain Controller all service packs and...
1
5038
by: Olav Tollefsen | last post by:
I get the included error message when trying to run my ASP.NET application under Windows Server 2003 (with all updates installed). How can I troubleshoot this? Olav File or assembly name...
2
5025
by: John Regan | last post by:
Hello All I am trying to find the owner of a file or folder on our network (Windows 2000 Server) using VB.Net and/or API. so I can search for Folders that don't follow our company's specified...
2
5202
by: Roger Twomey | last post by:
I am working on a filewatcher application. The premis is: User uploads an xml file onto the web server the filewatcher app sees the xml file filewatcher app reads the file and inserts...
1
3249
by: Christian Rühl | last post by:
hey! what i wanna do sounds very simple at first, but it turned out to be a real bone crusher... i want to check if a treeView node is checked and if a correspondent node in my xml config file...
3
14069
by: meettapan | last post by:
I want to create the log file as below:- 2007/03/09 19:12:08 : ~extasc_cdr_20061230.csv.vcdr 2007/03/09 19:23:02 : ~extasc_cdr_20061230.csv.vcdr 2007/03/09 19:42:13 :...
0
7202
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
7280
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
7460
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
5578
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,...
1
5014
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
3167
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...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
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...

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.