0

In my .aspx file I have:

<%@ assembly src="extensions.vb" %>
<%@ assembly src="debug.vb" %>

I need to be able to use the extensions defined in extensions.vb within my debug class in debug.vb but I am getting compiler error <function name> is not a member of <object> in debug.vb. What am I doing wrong?

Edit: structure of the two assemblies:

extensions.vb:

Namespace MyNamespace

Public Module MyModule

...

End Module

End Namespace

debug.vb:

Imports MyNamespace ' Also tried Imports MyNamespace.MyModule

Class Debug

...

End Class
ic3b3rg
  • 14,629
  • 4
  • 30
  • 53

2 Answers2

0

You need to import the namespace that contains extensions.vb in the source of debug.vb.

Imports MyNamespaceThatContainsExtensions
Fammy
  • 513
  • 3
  • 14
  • I tried that to no avail. I edited my question and added the structure of the two files. – ic3b3rg Jun 13 '11 at 21:26
  • The module must be public. See the answer to [this](http://stackoverflow.com/questions/3724891/extension-methods-in-referenced-assemblies). – Fammy Jun 13 '11 at 21:28
  • I went through that link but it looks like I'm still missing something. – ic3b3rg Jun 13 '11 at 21:36
0

In order to get this to work, I had to move the vb files to the application's App_Code folder and then import the namespace.

ic3b3rg
  • 14,629
  • 4
  • 30
  • 53