Today I started my first console application developmentin VS 2010.
After I added the below code
and build the application, the system throws the error message like
This error message suggests to add a reference to System.Web. When I look into it over the reference list, its was not there. I only have "System.Web.ApplicationServices" and "System.Web.Services". I dont know why its not there in the list?
Then my friend said, 'target framework may be different'. After that I checked the target framework, its was .NET Framework 4 Client Profile. Then I changed it as .NET Framework 4. Now my code works fine.
Hope this ll help you.
After I added the below code
System.Web.HttpUtility.UrlEncode(item)
and build the application, the system throws the error message like
Error message: 'HttpUtility' is not a member of 'Web'.
This error message suggests to add a reference to System.Web. When I look into it over the reference list, its was not there. I only have "System.Web.ApplicationServices" and "System.Web.Services". I dont know why its not there in the list?
Then my friend said, 'target framework may be different'. After that I checked the target framework, its was .NET Framework 4 Client Profile. Then I changed it as .NET Framework 4. Now my code works fine.
Hope this ll help you.
If you want to change the target framework, here are the instructions:
ReplyDeletehttp://msdn.microsoft.com/en-us/library/bb398202.aspx
The only way I could find to change the .NET framework version for an existing project using VS2010 was to edit the `*.vbproj` file.
ReplyDeletehttps://gist.github.com/dhollenbeck/379d7a784636ba86fa8f229cab1e24e7