I’m trying to write a console application that will run and remove/add items to the IP Granted table.
I have a web-based version of this running perfectly(standard asp.net program) and now I’d like to port some of the functionality to a console app, and I’m running into problems.
The console app reports missing references and how Microsoft.Web does not exist (but I have added the reference for Microsoft.Web.Adminsitration and set copy local and specific version to true). The Microsoft.Web.Administration dll is being reference from C:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll.
I had a similiar problem with the web-based version, but after a reference to System.Web, it’s fine.
However this fix is not working in the console application.
Is there an additional package I am missing/should use, or?
Are you using Visual Studio 2010 and .Net 4? If so, the following might help you:
http://blog.stevienova.com/2010/10/01/visual-studio-2010-console-app-where-is-my-system-web/
In short, it comes down to VS2010 having the default target for console projects set to the .NET Framework 4 Client Profile instead of .NET Framework 4. Changing it to the latter should enable you to reference System.Web.