❔ How to use DLL?
Hi guys, so i am trying to make a console application and need to use some functionality in these dll's. I use those residing in the bin folder.
i have tried to import nistmsclp_2gb.dll however i get an ": 'Could not load file or assembly 'nistmsclp_2gb.dll' or one of its dependencies" when i try to use some functionality. So this leads me to think that i need to import other dll's beside this wrapper dll, i however get an error "please make sure that the file is accessible and that it is a valid assembly or com component" when i try to import the native libraries whether it's x86 or x64. Any idea how to go about this? Thanks! I have included some documentation below.
51 Replies
Is it an open source / public library?
yes kind of
it's a NIST library
I'd like to try it out myself, do you have a link?
Hmm, a direct download link?
Youve got a link to a site perhaps?
Nope sorry, it looks sketch i know but it's safe lol
e
i mean, it's the legit nist site
Exactly
not saying everyone should just download it, but it's better than some random domain
I just need to use it to use their search function
What does your code look like?
Within your project, create a folder called something like "deps" or "dependencies"
Or maybe even smth like "native"
And copy those in there
could be that the DLLs are referenced but aren't being copied to the build directory
And then change all the .dll properties in the solution explorer to "copy if newer"
Then try again
their sample csharp app has a 4k loc program.cs lol
rip
scientists aren't known for pretty code
hence python is popular
i swear and their documentation isn't exactly user friendly lol
but im on it!
you got this
does this work for you @Ertan Köse ?
I lied btw, their source code for Program.cs is a bit above 6k loc
i was getting some snack doing it now 🙂
tis gon be a long night
Ok so unfortunately same error, i loaded them in as you said and change it to copy if newer
hm
btw thank you i appreciate it!
urgh, i hate this
It does work, it's just that it copies it into a deps sub folder output >.>
One sec, imma look for a proper copying solution
Open your .csproj file, and drop the following in there
@Ertan Köse
Okey on it
Okey same error but here is the thing the build action is set to content in the dll's do i perhaps need to change this maybe to embedded ressource, and do i still need the reference?
Did you get it to work?
Yes, I did
Nah, keep it as is
works for me
Show your csproj
holy moly 🙂 worst case i could use your console folder!
youve got the same references in there twice
>.>
Also, why tf are you on .net framework
disgustang
Hahah man i don't know any better
what sdk version are you on?
.net 7
omg
$newproject
When creating a new project, prefer using .NET over .NET Framework, unless you have a very specific reason to be using .NET Framework.
.NET Framework is now legacy code and only get security fix updates, it no longer gets new features and is not recommended.
https://cdn.discordapp.com/attachments/569261465463160900/899381236617855016/unknown.png
thanks!!! im downloading it now
btw do you have any resources to point me towards so i can learn this kind of stuff better
what kinda stuff
Not the language c# itself but more .net itself
i guess any book would do
you dont learn that kinda stuff from books in my view
you learn it over time
Actually true
@chatgpt plus user it's a success!! Thank you very much! You are truly an awesome person!
beep boop
Facts
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.