question

kavehrahimi-5744 avatar image
0 Votes"
kavehrahimi-5744 asked ·

Add dll file to references

Hi ,I want add dll file ch341dll.dll to references in vb.net,but it says the file is unsupported.
Is there any way to add it.
Please help
Thanks

dotnet-visual-basic
· 6
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

If Visual Studio says the dll is not supported than no you can add it. Now if you tell us more about the DLL in question and the project that may help to know why it's unsupported as there are many reasons why you received this message e.g. built with a higher .NET Framework etc.

0 Votes 0 ·

The file is used for a device called ch341a this is a hardware used to connect USB bus to a hardware uses i2c protocol.the manufacturer company is Chinese.

0 Votes 0 ·

Your best option is to contact the manufacturer company, use Google translate to ask about the unsupported issue. Otherwise try changing the .NET Framework your project is to see if you can determine if using the DLL is not supported because it expected a specific version of the .NET Framework. I would do this in a new project without any code.

0 Votes 0 ·
Show more comments

There are many types of DLLS. People should not say something is a DLL without saying what type it is. The original Windows API is nearly all DLLs, often called native DLLs. There are also DLLs that are called COM DLLs. Adding a reference requires a type library so if ch341dll.dll is a native DLL then you cannot add a reference for it. As Karen said, you need to refer to the documentation of ch341dll.dll; does it provide samples of using it with C# and VB.Net? If not then it is unlikely you can add a reference.

0 Votes 0 ·

1 Answer

SimpleSamples avatar image
0 Votes"
SimpleSamples answered ·

Use the icsharpcode/ILSpy: .NET Decompiler to determine what the DLL is. If ILSpy says that the file does not contain a managed assembly then you need to use DllImport instead of adding a reference. You can download compiled binaries of ILSpy from the releases page.


·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.