Working in VB.NET. Is anyone else experiencing any missing intellisense for properties or methods on the new Web API classes? For example, on the HttpRequestMessage object, I make heavy use of the CreateResponse(Of T) extension method, but I am not seeing
any intellisense for it so I don't know if there are overloads I could be using. Do I need to add any config settings or something else to enable intellisense for these extension methods?
I have a reference to System.Web.Http.dll in my project that points to the assembly downloaded with MVC 4 ( C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Http.dll) and Imports at the top of my code file for both System.Net.Http
and System.Web.Http. Right-clicking on the CreateResponse method in the code editor and selecting Go to Definition opens the Object Browser to the System.Web.Http assembly, but there are no entries in it for the System.Net.Http namespace and no listing for
CreateResponse at all. If I do a search in the Object Browser for CreateResponse, it returns a number of entries, all supposedly members of System.Net.Http.HttpRequestMessageExtensions. If I add an Imports statement for that, I get a code editor blue squiggly
underneath the line with the error "HttpRequestMessageExtensions is ambiguous in the namespace System.Net.Http."
Rich, we discussed this issue with our team here and noticed that this is most probably due to multiple extension methods with the same name in our sources(We have multiple CreateResponse extension methods in System.Web.Http\HttpRequestMessageExtensions.cs).
This seems to be a problem with VB.NET in general and does not happen in C#.
I was able to repro this problem in VB.NET by creating simple non-Web API projects.
Thanks,
Kiran Challa
Marked as answer by richmiller on Aug 20, 2012 07:20 PM
I just imported System.Net.Http and this corrected the problem. System.Web.Http is imported by default, which causes the conflict (and keeps Visual Studio from recognizing that you need to import System.Net.Http.) Hope this helps.
richmiller
Member
40 Points
51 Posts
Intellisense for Request.CreateResponse MIssing?
Aug 17, 2012 08:03 PM|LINK
Working in VB.NET. Is anyone else experiencing any missing intellisense for properties or methods on the new Web API classes? For example, on the HttpRequestMessage object, I make heavy use of the CreateResponse(Of T) extension method, but I am not seeing any intellisense for it so I don't know if there are overloads I could be using. Do I need to add any config settings or something else to enable intellisense for these extension methods?
Rich
Ahmed Abdulr...
Participant
906 Points
232 Posts
Re: Intellisense for Request.CreateResponse MIssing?
Aug 17, 2012 08:38 PM|LINK
any dynamic type at most languages cannot be supported (from IDEs) by Intellisense
Kiran Challa
Participant
1442 Points
281 Posts
Microsoft
Re: Intellisense for Request.CreateResponse MIssing?
Aug 18, 2012 01:41 AM|LINK
CreateResponse extension method is present in System.Web.Http.dll and the namespace where this extension is present is System.Net.Http.
Kiran Challa
richmiller
Member
40 Points
51 Posts
Re: Intellisense for Request.CreateResponse MIssing?
Aug 20, 2012 01:26 PM|LINK
Kiran,
I have a reference to System.Web.Http.dll in my project that points to the assembly downloaded with MVC 4 ( C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Http.dll) and Imports at the top of my code file for both System.Net.Http and System.Web.Http. Right-clicking on the CreateResponse method in the code editor and selecting Go to Definition opens the Object Browser to the System.Web.Http assembly, but there are no entries in it for the System.Net.Http namespace and no listing for CreateResponse at all. If I do a search in the Object Browser for CreateResponse, it returns a number of entries, all supposedly members of System.Net.Http.HttpRequestMessageExtensions. If I add an Imports statement for that, I get a code editor blue squiggly underneath the line with the error "HttpRequestMessageExtensions is ambiguous in the namespace System.Net.Http."
Thanks,
Rich
Kiran Challa
Participant
1442 Points
281 Posts
Microsoft
Re: Intellisense for Request.CreateResponse MIssing?
Aug 20, 2012 05:38 PM|LINK
Rich, we discussed this issue with our team here and noticed that this is most probably due to multiple extension methods with the same name in our sources(We have multiple CreateResponse extension methods in System.Web.Http\HttpRequestMessageExtensions.cs). This seems to be a problem with VB.NET in general and does not happen in C#.
I was able to repro this problem in VB.NET by creating simple non-Web API projects.
Kiran Challa
richmiller
Member
40 Points
51 Posts
Re: Intellisense for Request.CreateResponse MIssing?
Aug 20, 2012 07:20 PM|LINK
Thanks, Kiran. Glad to know it was a symptom of other issues with my installation.
Rich
grantdaddy
Member
4 Points
5 Posts
Re: Intellisense for Request.CreateResponse MIssing?
Nov 15, 2012 05:24 PM|LINK
Did you guys find a way to work around this problem of the multiple CreateResponse extensions methods? I am having the same issue Rich reported.
SteveHurcomb...
Member
7 Points
2 Posts
Re: Intellisense for Request.CreateResponse MIssing?
Nov 16, 2012 01:39 PM|LINK
Hi Kiran,
We are having this exact problem.
Do you have a resolution yet?
Cheers
Steve
grantdaddy
Member
4 Points
5 Posts
Re: Intellisense for Request.CreateResponse MIssing?
Nov 16, 2012 01:42 PM|LINK
Steve,
I just imported System.Net.Http and this corrected the problem. System.Web.Http is imported by default, which causes the conflict (and keeps Visual Studio from recognizing that you need to import System.Net.Http.) Hope this helps.
Grant