Prev: Exception in the DataGridView for a BLOB field in .Net 2008
Next: vandalismus, haushaltsversicherung, hausratsversicherung wasserschaden, hausratversicherung diebstahl, bedingungen versicherung,
From: prodata on 14 Feb 2010 07:06 Got a problem trying to access a 3rd party DLL from a VB2008 project (first time I've tried this, so not too clued up on what might be wrong): I've got a simple demo VB project from the maker which accesses the DLL and which works OK, so I know that in principle it should work. But if I create my own empty VB2008 project and 'Add Existing Item' for the basic demo form then on testing I can't get past a 'DLL not found' error. If I try to add a reference to the DLL I get an error that the file 'may not be accessible or it is not a valid assembly or COM component', which I guess must be a big clue but one that I can't make sense of because: (i) The demo works fine in the same configuration (AFAICT) (ii) The DLL has been copied into the project's /bin/debug folder (and so I don't think that it would be inaccessible) I know this isn't much to go on, but can anyone suggest the type of reason for the error. Is there, for example, some other way that I should be introducing the DLL into the project environment other than 'Add Reference'?
From: prodata on 14 Feb 2010 11:40 OK - figured it out - the maker's DLL seems to have an undocumented dependency on a completely different helper DLL that isn't directly relevant to the project. Once I add in this second DLL then all works fine. Looks like the exception for the unavailability of the second DLL gets passed up the chain to generate an error that only reports unavailability of the main DLL and so ends up being fairly misleading.
From: Siv on 14 Feb 2010 12:07
prodata, You probably need to add a reference to it in your new project. To do that go to the "Project" menu in Visual Studio and select the bottom opption that will say <Your Project Name> Properties. When there go to the "References" tab dwn the left side of the screen. In the top part of the screen you will see all the things taht area referenced by your project. Click the "Add" button. In the dialog that comes up go to the "browse" tab and then use that to navigate to where the DLL is you want to use. When you have it selected click "OK" and it should then be accessible from within your project. All the best, Siv -- Martley, Near Worcester, UK "prodata" wrote: > Got a problem trying to access a 3rd party DLL from a VB2008 project > (first time I've tried this, so not too clued up on what might be > wrong): > > I've got a simple demo VB project from the maker which accesses the > DLL and which works OK, so I know that in principle it should work. > > But if I create my own empty VB2008 project and 'Add Existing Item' > for the basic demo form then on testing I can't get past a 'DLL not > found' error. > > If I try to add a reference to the DLL I get an error that the file > 'may not be accessible or it is not a valid assembly or COM > component', which I guess must be a big clue but one that I can't make > sense of because: > > (i) The demo works fine in the same configuration (AFAICT) > > (ii) The DLL has been copied into the project's /bin/debug folder > (and so I don't think that it would be inaccessible) > > I know this isn't much to go on, but can anyone suggest the type of > reason for the error. Is there, for example, some other way that I > should be introducing the DLL into the project environment other than > 'Add Reference'? > . > |