简体   繁体   中英

Where are project level imports stored in Visual Studio 2008?

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.

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM