Simple asp.net web cannot find dll.

I have created a simple web using Visual Studio 2008 and want to use a dll that I know is working. I have put the dll in the BIN folder and have a button that calls the dll ie

 Public Sub calc_npk_decide(ByRef temp_N As Double, ByRef temp_P As Double)
 
        runnpd(3000,298, 0.1, 40, temp_P, temp_N)

        If temp_N < 0 Then temp_N = 0
    End Sub

I get the error
Unable to load DLL 'PrimeDll.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

The dll is declared in a separate module as
 Declare Sub runnpd Lib "PrimeDll.dll" (ByVal SeasonYield As Double, _
                          ByVal SoilCst As Double, _
                          ByVal SoilKp As Double, _
                          ByVal EconGrainVal As Double, _
                          ByRef Rate1 As Double, _
                          ByRef Rate2 As Double)

This dll works fine in a standard windows application. It is a straight forward calculation and as far I know has no dependancies.
milkwoodAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dinomixCommented:
Place the dll in the debug folder instaed of bin (or release if you are building final version). Without a path specification the app will look for dll in the same folder as the app executable which is bin\debug when you press play in studio.
0
milkwoodAuthor Commented:
I don't appear to have a debug folder.
0
milkwoodAuthor Commented:
In the build- configuration manager there is only the choice of debug, release is not an option
0
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

dinomixCommented:
Make sure it is in the same folder as the asp file you are producing, is the asp file in the bin folder?
0
milkwoodAuthor Commented:
My directory setup is as follows

J:\Run_WebNpd                               //// main directory web
   (-) App_code
             - docalc.vb                         ///  some code
        App_Data
    (-) BIN
            --PrimeDll.Dll                         /// problem dll
    (-) Default.aspx
            -- Default.aspx.vb
         web.config



I have tried putting the Primedll.dll i the main directory with no effect
       
   
0
Sachintana DissanayakeSenior Web DeveloperCommented:
Add the dll as the reference to the web project.

    First remove/delete the dll from the bin folder from solution explorer.
    Right click on the web project from solution explorer.
    Select "Add reference..." and click the Browse tab.
    Select the PrimeDll.dll from the file system.
    Build the web project, now you should be okey.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
milkwoodAuthor Commented:
Unfortunately when I try to add a reference to the DLL I get an error of
"A reference to PrimeDll.dll could not be added. This is not a COM component"

This dll was written in C++ some time ago using Visual Studio. I still the source somewhere so I suppose I could re-compile but I thought a dll was a dll and it works fine in windows apps
0
Sachintana DissanayakeSenior Web DeveloperCommented:
So, you have to create an .net compatible assembly using that COM dll.
Use tlbimp command line tool to COM dll to CLR (common language runtime) dll. Check other options as well.
    tlbimp PrimeDll.dll\1

Hope this helps, if not please attache the dll...
0
milkwoodAuthor Commented:
Tried the tlbimp and got
"The input file 'C:\Temp\PrimeDll.dll' is not a valid type library"

Experts-Exchange does not allow uploading dll. I can email it if you want to send your address to mikeATknack.com.au
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.