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

Deploying with Custom References

Using VS2005:

We have created custom class projects that output to DLL files.

In our App, we add these to the list of Solution References and include them
in the code.

When the App compiles, it places copies of the DLL files in the output
(bin's Debug/Release folders).

Now we are trying to test the deployment. We created an Installer project
and listed each of the DLL files with the Exclude property set to False.

We install the application, and there are no errors.

When we launch the application, it appears to be crashing about where it is
supposed to be accessing one of the DLL files.

Is there something special that needs to be done to install DLL files along
with a project?

I tried manually registering them using the Run command and "regsvr32", but
none of the DLLs have entry points, and nothing was registered.
Jul 11 '08 #1
5 1238
Ok, I'm not sitting idly by waiting for a response. I'm trying to get this
fixed.

That being said, here is some more information:

In the Installer, I had originally placed all of the DLLs in the same folder
as the executable, but the Application Folder's DefaultLocation was directed
to a folder on our network. The install worked, but the application crashed.

Take 2: Thinking this is what I want to eventually do, I moved the DLL files
into a custom subfolder of the Common Files Folder. This time, my program
would not even start! Wow! Very bad.

Take 3: I changed the Application Folder's DefaultLocation to "C:\TEMP" and
placed all of the DLLs in this same folder. Eureka! Now the program runs fine.

So, is there a way to deply an application and give it an install location
on the network? My next step in debugging is to try this using one of the
network's drive letters.

If someone is knowledgeable about these things, please inform me what I'm
doing incorrectly.

Thanks.

"jp2msft" wrote:
Using VS2005:

We have created custom class projects that output to DLL files.

In our App, we add these to the list of Solution References and include them
in the code.

When the App compiles, it places copies of the DLL files in the output
(bin's Debug/Release folders).

Now we are trying to test the deployment. We created an Installer project
and listed each of the DLL files with the Exclude property set to False.

We install the application, and there are no errors.

When we launch the application, it appears to be crashing about where it is
supposed to be accessing one of the DLL files.

Is there something special that needs to be done to install DLL files along
with a project?

I tried manually registering them using the Run command and "regsvr32", but
none of the DLLs have entry points, and nothing was registered.
Jul 11 '08 #2
jp2msft wrote:

When loading Assemblies (Dll's), the Framework uses its own set of rules
about where to look and the DefaultLocation folder is one of those places.
In the Installer, I had originally placed all of the DLLs in the same folder
as the executable, but the Application Folder's DefaultLocation was directed
to a folder on our network. The install worked, but the application crashed.
.... because in trying to load the Dll, it looked in the DefaultLocation
and the Assembly wasn't there.
Take 2: Thinking this is what I want to eventually do, I moved the DLL files
into a custom subfolder of the Common Files Folder. This time, my program
would not even start! Wow! Very bad.
Agreed.
Take 3: I changed the Application Folder's DefaultLocation to "C:\TEMP" and
placed all of the DLLs in this same folder. Eureka! Now the program runs fine.
.... so the Normal search sequence that the Framework uses found the Dll.

You need to add a .exe.config (app.config in the project, copied when
you rebuild it) that specifies where the executable should look for its
dependent assemblies which, IIRC, is based on the /installed/ location
of the executable, not the DefaultLocation.

[program*.exe.config*]
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="---assembly---name---"
publicKeyToken="---"
culture="neutral"
/>
<codeBase
version="1.0.0.0"
href=".\*library.dll*" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
So, is there a way to deply an application and give it an install location
on the network? My next step in debugging is to try this using one of the
network's drive letters.
Be warned: The Framework does not distinguish between your [user's]
'Q'-drive, say, and www.DodgyAndDangerousSoftware.com. To run /any/
..Net code from a network fileshare, you must establish Code Access
Security Policies to allow this. Your program /might/ work without this
but any code /not/ installed on a local disk is treated as suspect and
run in a security "sandbox" with far lower permissions than you might
expect.
>I tried manually registering them using the Run command and "regsvr32", but
none of the DLLs have entry points, and nothing was registered.
Regsvr32 is for registering COM dll's, not .Net assemblies; they are
/totally/ different things and need different tools to "register" them.

HTH,
Phill W.
Jul 14 '08 #3
Thanks Phil.

I think that gave me enough information to go find out how to solve my
problems.

Regards,
Joe

"Phill W." wrote:
jp2msft wrote:

When loading Assemblies (Dll's), the Framework uses its own set of rules
about where to look and the DefaultLocation folder is one of those places.
In the Installer, I had originally placed all of the DLLs in the same folder
as the executable, but the Application Folder's DefaultLocation was directed
to a folder on our network. The install worked, but the application crashed.

.... because in trying to load the Dll, it looked in the DefaultLocation
and the Assembly wasn't there.
Take 2: Thinking this is what I want to eventually do, I moved the DLL files
into a custom subfolder of the Common Files Folder. This time, my program
would not even start! Wow! Very bad.

Agreed.
Take 3: I changed the Application Folder's DefaultLocation to "C:\TEMP" and
placed all of the DLLs in this same folder. Eureka! Now the program runs fine.

.... so the Normal search sequence that the Framework uses found the Dll.

You need to add a .exe.config (app.config in the project, copied when
you rebuild it) that specifies where the executable should look for its
dependent assemblies which, IIRC, is based on the /installed/ location
of the executable, not the DefaultLocation.

[program*.exe.config*]
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="---assembly---name---"
publicKeyToken="---"
culture="neutral"
/>
<codeBase
version="1.0.0.0"
href=".\*library.dll*" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
So, is there a way to deply an application and give it an install location
on the network? My next step in debugging is to try this using one of the
network's drive letters.

Be warned: The Framework does not distinguish between your [user's]
'Q'-drive, say, and www.DodgyAndDangerousSoftware.com. To run /any/
..Net code from a network fileshare, you must establish Code Access
Security Policies to allow this. Your program /might/ work without this
but any code /not/ installed on a local disk is treated as suspect and
run in a security "sandbox" with far lower permissions than you might
expect.
I tried manually registering them using the Run command and "regsvr32", but
none of the DLLs have entry points, and nothing was registered.

Regsvr32 is for registering COM dll's, not .Net assemblies; they are
/totally/ different things and need different tools to "register" them.

HTH,
Phill W.
Jul 14 '08 #4
Wait!

Phil, a quick question:

Where is a good spot to look for this? I don't exectly know what it is
called, and googling for "App.config" produced thousands of "how to" for
websites.

Your version of VS must be a little different from mine, because I did not
have the particular xmlns schema you used above. My VS2005 Pro had the
following urn:schemas-microsoft-com: datatypes, rowset, xml-data, xml-msdata,
xml-msdatasource, and xslt.

What is a good name for what I am trying to do? I'd even go so far as to
accept a web link to a tutorial if you know of one! :)

"Phill W." wrote:
jp2msft wrote:

When loading Assemblies (Dll's), the Framework uses its own set of rules
about where to look and the DefaultLocation folder is one of those places.
In the Installer, I had originally placed all of the DLLs in the same folder
as the executable, but the Application Folder's DefaultLocation was directed
to a folder on our network. The install worked, but the application crashed.

.... because in trying to load the Dll, it looked in the DefaultLocation
and the Assembly wasn't there.
Take 2: Thinking this is what I want to eventually do, I moved the DLL files
into a custom subfolder of the Common Files Folder. This time, my program
would not even start! Wow! Very bad.

Agreed.
Take 3: I changed the Application Folder's DefaultLocation to "C:\TEMP" and
placed all of the DLLs in this same folder. Eureka! Now the program runs fine.

.... so the Normal search sequence that the Framework uses found the Dll.

You need to add a .exe.config (app.config in the project, copied when
you rebuild it) that specifies where the executable should look for its
dependent assemblies which, IIRC, is based on the /installed/ location
of the executable, not the DefaultLocation.

[program*.exe.config*]
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="---assembly---name---"
publicKeyToken="---"
culture="neutral"
/>
<codeBase
version="1.0.0.0"
href=".\*library.dll*" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
So, is there a way to deply an application and give it an install location
on the network? My next step in debugging is to try this using one of the
network's drive letters.

Be warned: The Framework does not distinguish between your [user's]
'Q'-drive, say, and www.DodgyAndDangerousSoftware.com. To run /any/
..Net code from a network fileshare, you must establish Code Access
Security Policies to allow this. Your program /might/ work without this
but any code /not/ installed on a local disk is treated as suspect and
run in a security "sandbox" with far lower permissions than you might
expect.
I tried manually registering them using the Run command and "regsvr32", but
none of the DLLs have entry points, and nothing was registered.

Regsvr32 is for registering COM dll's, not .Net assemblies; they are
/totally/ different things and need different tools to "register" them.

HTH,
Phill W.
Jul 14 '08 #5
jp2msft wrote:
Where is a good spot to look for this? I don't exectly know what it is
called, and googling for "App.config" produced thousands of "how to" for
websites.
Yep; pretty much every .Net web site has an app.config in it whose use
is completely and utterly different from what we're trying to achieve
here. :-}

I'm afraid I can't recall /where/ I found this originally (probably the
same rummaging around that you're doing at the moment) and finding it
really relies on knowing the right "magic words" - try "codeBase" and
"dependentAssembly" and you should get [a bit] close[r].
Your version of VS must be a little different from mine
.... yes; my example was taken from VS'2003 ...
What is a good name for what I am trying to do?
It seems to go under the banner of "sharing or reusing Assemblies that
/can't/ go in the GAC (Global Assembly Cache)"
I'd even go so far as to accept a web link to a tutorial if you know
of one! :)
Not a tutorial as such, but at least a definitive list of the elements
you've got to play with ...

http://msdn.microsoft.com/en-us/libr...35(VS.80).aspx

Well; as definitive as we're ever likely to get. ;-)

HTH,
Phill W.
Jul 15 '08 #6

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

Similar topics

19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
2
by: Greg W. | last post by:
In our setup project, we have the standard web application folder, but we also have 4 web custom folders (virtual directories) that are created at the same level as the web application folder...
3
by: Chris Dunaway | last post by:
A quick scan of the group did not immediately reveal an answer to my questions so here goes. First let me describe my app and then I'll ask the questions. I am writing a Windows Forms App (not...
7
by: Adam | last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have developed the handler, 1. installed it into the gac 2. added it to the machine.config: <httpHandlers> <add verb="*"...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
12
by: Jozef | last post by:
I have a custom menu bar that I seem to be having trouble deploying with the database. This type of custom object is kept in the System.mdw correct? I have a target machine that won't let go of...
6
by: Ryan | last post by:
Is there any way to save a VB 2005 created application as an .MSI install file? The only method I see is to publish as a .EXE. Curious because I want to push out an application with Group Policy....
12
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD...
4
by: HabibBhutto | last post by:
Hi Guys, Thanks in advance...! :) I am developing a web application for IPhone using componentOne IPhone and ASP.Net 3.5 there is problem into deploying the site after deplying when a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.