• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 672
  • Last Modified:

dll problem with vb.net

I have a dll from a vendor. I have to link to it in a vb.net program. It all works fine IF the dll is in the same folder as the executable file. If I move the dll to another folder that is in the normal search path (\windows\system32, for example), the program fails.

I have looked at the References in the project, and the only difference I see between this dll and any others in the project is that "copy local" is set to "True" for this dll. I tried setting it to "False" but then I get  an error on compilation:

Error      1      Assembly 'bin\mydll.dll' must be strong signed in order to be marked as a prerequisite.

I don't have source for this dll. The vendor is not particularly friendly. If I need to get them to change something, I'll have to be quite specific about it.

0
1_21gigawatts
Asked:
1_21gigawatts
1 Solution
 
divinewind80Commented:
Have you checked the authority of the user or profile running the app on the system32 folder?  It could be that this user cannot access the file.  

Just a thought.
0
 
joriszwaenepoelCommented:
You should be happy.  If you deploy the dll to the same folder as your application, you don't risk that it will be overwritten by another version because another application is installed later, chich could cause your application to fail.

So, deploying the dll to the folder where your app is located is better then putting it in System32.
0
 
stsanzCommented:
Set Project Properties/Reference Path to point to the chosen folder.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
1_21gigawattsAuthor Commented:
@joriszwaenepoel: Normally, I would agree to your statement, but in this case, having the dll in the exe's directory causes problems with the application program. So, that's really not an option. But in general, I am a pretty firm believer in "the system directories are for the system, not for the applications."

@stsanz: A) I tried setting Reference Paths, and it didn't seem to make a difference AND
B) The installer needs to put the application into specific directories that will be unknown until install time, and I don't have a fixed location for the dll.

In general, I don't understand why this is happening, except that the two other dlls I'm using are much older, probably non-.net things, while the one causing problems is most definitely a .net item.

There's GOT to be a way to deal with this.
0
 
1_21gigawattsAuthor Commented:
@ divinewind80:

There are other dlls used by the same program in system32, and they work fine.
0
 
joriszwaenepoelCommented:
Maybe you can put the dll in a subfolder of the application folder, and then use the configuration file to let the application know where to search.

Look for "assemblybinding" and "probing" elements in the documentation for more information.
0
 
CodeCruiserCommented:
0
 
1_21gigawattsAuthor Commented:
@CodeCruiser

I can't use the GAC as the dll is not strongly named, and I have no control over the dll. Again, the people who own this dll are not even slightly cooperative.

I CAN'T believe this is so complicated. I'm way more at home programming microcontrollers.
0
 
1_21gigawattsAuthor Commented:
Well, the vendor got a new programmer who is surprisingly cooperative. He's going to make the necessary changes to get this dll into the GAC, It'll take a couple of weeks, but it will be done.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now