简体   繁体   English

Visual Studio 2008 中的项目级导入存储在哪里?

[英]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.我在 Visual Studio 2008 中有一个 Web 服务应用程序项目。这应该是一个 ASP.Net 2.0 项目,并且在某些时候已经使用 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. VS 在项目级导入中添加了 System.Linq 和 System.Xml.Linq,但是当我将项目重新定位到 2.0 时,这些项目级导入仍然存在。

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.因为 Web 服务应用项目没有详细的 window 用于编辑项目引用,所以我找不到如何删除这些项目级别的导入。

There is no.proj file which is where I would assume these were included.没有.proj 文件,我认为这些文件包含在其中。

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.在项目级导入“System.Linq”中指定的命名空间或类型不包含任何公共成员或找不到。 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页面底部将是一个“Imported Namespaces”组
  • 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. 1.在 Visual Studio 中,展开“References”文件夹并通过右键单击并选择删除来删除每个有问题的引用。

2. Edit the project file and delete the offending references from their respective ItemGroup section. 2.编辑项目文件并从其各自的ItemGroup部分中删除有问题的引用。

I had the same issue with a web application project - the offending lines were in web.config.我在 web 应用程序项目中遇到了同样的问题 - 违规行位于 web.config 中。 Not sure if the web service project has a web.config, but look in whatever it uses as an equivalent.不确定 web 服务项目是否具有 web.config,但请查看它使用的任何等效项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio网站中的项目设置实际存储在哪里? - Where are project settings in a Visual Studio website actually stored? 面向ASP.net 2.0的VS2008:项目级导入警告 - VS2008 targeting ASP.net 2.0: Project-level imports warning 将DateTime变量传递到Visual Studio 2008中的SQL Server存储过程中 - Passing DateTime variables into SQL Server stored procedures in Visual Studio 2008 如何在Visual Studio 2012/2015中升级Visual Studio 2008项目?(如何打开项目) - How to upgrade Visual studio 2008 project in Visual Studio 2012/2015 ?(How to Open Project) 在Visual Studio 2008中引用dll二进制文件或引用项目时有区别吗? - Is there a difference when referencing dll binaries or referencing a project in Visual Studio 2008? Visual Studio 2008 - 解决方案的条件编译符号,而不是项目 - Visual Studio 2008 - Conditional Compilation Symbol for Solution, not Project Visual Studio 2008 asp.net项目模板丢失 - visual studio 2008 asp.net project templates missing 在Visual Studio 2008中按项目或解决方案更改默认浏览器? - Change default browser by project or solution in Visual Studio 2008? 在Visual Studio 2008项目中更改文件夹中整个文件的属性 - Change the property of entire files in folder in Visual Studio 2008 project 在Visual Studio 2008中的Web应用程序项目中创建程序集 - Create an assembly in a Web Application project in Visual Studio 2008
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM