1

I am trying to get a VB.NET DLL used as a reference on a aspx.cs page.

I have added the compiled DLL and it's resources to a bin folder, and I have added the reference and added

using my_DLL;

Then I go to call a function like this....

public string foobar = concat_function_DLL("foo" , "bar"); 

but, I get the red sqwiggles under concat_function_DLL (my DLL function) and this message :

"The name 'concat_function_DLL' does not exist in the current context

I have tried removing the bin folder, removing the reference, re-creating the bin folder and then re-adding the reference, but it still doesn't want to recognize anything from my DLL.

The DLL will work completely fine from my VB.Net webpage so I know it cannot be a problem with the DLL. Maybe there is some step I am missing? I thought I read that .NET DLLs are interchangeable between both vb.net and c#.net.

Thank you!

1
  • I should add that I can open my_DLL.xml and read it perfectly fine from the bin folder, so the DLL is there.... but if I click on my_DLL and try to 'peak deffinition' it says "Cannot navigate to definition" Commented Sep 28, 2015 at 17:58

1 Answer 1

3

public string foobar = concat_function_DLL("foo" , "bar");

You are calling a method, concat_function_DLL, but you aren't specifying the type that declares it.

C# won't automatically put "global" methods from VB.NET modules in scope. Use this:

public string foobar = YourModuleName.concat_function_DLL("foo" , "bar"); 

Or, if you are using C# 6 (Visual Studio 2015), then you can use the VB.NET module and use it as you were before. Add this using statement:

using static my_DLL.YourModuleName;

Then you can just use the method as you were previously.

Sign up to request clarification or add additional context in comments.

1 Comment

Great! I am only on VS2013 but your first solution did it for me! I did not know that I had to go like this MyDLL.StringTools.concat_fuction_DLL("foo", "bar"); thanks so much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.