ASP.NET MVC 2 VB, Not recognising my import.

Posted by SLC on Stack Overflow See other posts from Stack Overflow or by SLC
Published on 2010-03-31T09:02:01Z Indexed on 2010/03/31 9:03 UTC
Read the original article Hit count: 313

I had a problem with a project I converted from C# to VB, in that the VB version it cannot seem to find an object even though I declared it with an Import statement at the top.

I created a new, default MVC 2 VB project, and the same problem occurs there.

I create a new MVC 2 application, I then add a reference to System.Data.Services.Client, and in my Index.aspx, in the Content area, I type

<% Dim x As DataServiceQueryContinuation %> which is what I want to use. It gives me a blue squiggly line and says Type 'DataServiceQueryContinuation' is not defined.

At the top of the page, I add this:

<%@ Import Namespace="System.Data.Services.Client" %>

The error persists. My original C# version has no such error.

I also get this warning:

Warning 2 Namespace or type specified in the Imports 'System.Data.Services.Client' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. e:\ASPNETDEBUG\MvcApplication1\MvcApplication1\Views\Home\Index.aspx 10 9 MvcApplication1

Examining the DLL using the tool provided shows that it does have a public member. Also when typing the above, System.Data. provides intellisense but there is no 'Services'.

Any ideas?

© Stack Overflow or respective owner

Related posts about visual-basic

Related posts about asp.net-mvc-2