开发者

How to assemble assemblies?

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 debu开发者_如何学编程g 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


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

Imports MyNamespaceThatContainsExtensions


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜