views:

893

answers:

3

I have a Web Service Application Project in Visual Studio 2008. This is supposed to be an ASP.Net 2.0 project and at some point this has been rebuilt using 3.5.

VS has kindly added in project level imports to System.Linq and System.Xml.Linq, but when I have re-targeted the project at 2.0 these project level imports have remained.

Because the Web Service Application Project does not have the detailed window for editing project references I cannot find how to remove these project level imports.

There is no .proj file which is where I would assume these were included.

I cannot now build the project as it fails, even though I only get warnings (no errors reported) such as this:

Namespace or type specified in the project-level Imports 'System.Linq' 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.

Help would be much appreciated.

+1  A: 

You can do one of either two things.

1. In Visual Studio, expand the "References" folder and delete each offending reference by right-clicking and selecting delete.

2. Edit the project file and delete the offending references from their respective ItemGroup section.

Andrew Hare
The references are not there any more. That is why the project level imports are failing. This project type does not have a .proj file as far as I can see.
Charlie
I believe Charles is taking about Imports, not references.
JaredPar
+1  A: 

Do the following

  • Right Click on the project and choose properties
  • Navigate to the References Tab
  • At the bottom of the page will be a "Imported Namespaces" group
  • Uncheck the namespaces you don't wanted imported
JaredPar
+1  A: 

I had the same issue with a web application project - the offending lines were in web.config. Not sure if the web service project has a web.config, but look in whatever it uses as an equivalent.

chris