Click here to Skip to main content
15,882,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The name 'HttpContext' does not exist in the current context.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.QueryParsers;
using Lucene.Net.Search;
using Lucene.Net.Store;
using Version = Lucene.Net.Util.Version;
using System.Web;

I had these already.
Uday P.Singh 21-Mar-12 2:30am    
where are you using HttpContext in your code can you show us the code , so that we can help you better.
Joel Tan Wei Shan 21-Mar-12 3:38am    
public static string _luceneDir = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "lucene_index");
private static FSDirectory _directoryTemp;
private static FSDirectory _directory

but I solved it already , thanks anyway :)

1 solution

Although you have included System.Web in your using statements, have you actually referenced the System.Web dll in your project ?
Share this answer
Joel Tan Wei Shan 21-Mar-12 2:28am    
I cant find System.Web inside my visual studio 2010,can you help me with this?
Wayne Gaylard 21-Mar-12 2:41am    
If your project targets .Net 3.5 or 4.0 client profile, it won't be available under Add Reference. You need to change your target framework to the full version, then you will see it under Add References dialogue - .Net tab.
Joel Tan Wei Shan 21-Mar-12 2:49am    
Mine is .Net Framework 4 Client Profile, So how do I change it to the full version?. I tried to search for System.Web dll online but could find it
Wayne Gaylard 21-Mar-12 3:01am    
Right click your project, then select properties. In the Application tab you should see a Target Framework selection box where you can change it to .Net Framework 4 .
Sergey Alexandrovich Kryukov 21-Mar-12 3:30am    
No, change the target from "4.0 Client Profile" to "4.0".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900