首页 \ 问答 \ 添加程序集引用后,命名空间中不存在类型或命名空间名称“ComponentModel”(The type or namespace name 'ComponentModel' does not exist in the namespace after adding an assembly reference)

添加程序集引用后,命名空间中不存在类型或命名空间名称“ComponentModel”(The type or namespace name 'ComponentModel' does not exist in the namespace after adding an assembly reference)

我有一个奇怪的问题,证明很难诊断。 将包含命名空间Matrix.System的程序集引用添加到Windows服务项目后,我现在在编译服务时收到此错误:

命名空间“Matrix.System”中不存在类型或命名空间名称“ComponentModel”类型或命名空间名称“ServiceProcess”在命名空间“Matrix.System”中不存在

但是在服务中生成错误:

private System.ComponentModel.IContainer components = null;
private System.ServiceProcess.ServiceInstaller serviceInstaller1;

在服务设置项目中,我得到了这个:

无法找到程序集“Apache.NMS.ActiveMQ.dll”的依赖项“IONIC.ZLIB”(Signature ='EDBE51AD942A3F5C'Version ='1.9.1.5')

NMS程序集已经在安装项目中,一切正常,直到我添加了Matrix.System程序集


I have a strange problem that's proving difficult to diagnose. After adding an Assembly reference that contains the namespace Matrix.System to a Windows Service project, I'm now getting this error when compiling the service:

The type or namespace name 'ComponentModel' does not exist in the namespace 'Matrix.System' The type or namespace name 'ServiceProcess' does not exist in the namespace 'Matrix.System'

The errors are generated in the service though:

private System.ComponentModel.IContainer components = null;
private System.ServiceProcess.ServiceInstaller serviceInstaller1;

and in the service setup project I'm getting this:

Unable to find dependency 'IONIC.ZLIB' (Signature='EDBE51AD942A3F5C' Version='1.9.1.5') of assembly 'Apache.NMS.ActiveMQ.dll'

the NMS assembly is already in the setup project and everything was working fine until I added the Matrix.System assembly


原文:https://stackoverflow.com/questions/11373553
更新时间:2022-09-03 16:09

最满意答案

我如何[配置IDEA] ...以便[它] ...创建jar文件并将其复制到第一个...的lib文件夹中...

您无法真正配置IDEA直接执行此操作。 虽然您可以在“项目结构”对话框中配置工件,但没有复制工件的规定。 IntelliJ IDEA是一个IDE,而不是构建工具。 虽然它在遵守和建设方面可以做很多事情,但它有其局限性。

一种可能的hackish方式是转到项目结构中的Artifact定义。 在那里,有“预处理”和“后处理”选项卡,他们可以选择运行Ant目标。 因此,您可以创建一个简单的Ant目标来进行复制。 但最后,我认为你问题的最佳答案是:

也许是一个更好的问题:按照依赖关系顺序手动构建多个工件的推荐方法是什么?

是使用诸如Ant,Maven或Gradle之类的构建工具来构建项目。


How can I [configure IDEA] ... so that [it] ... creates the jar file and copies it to the lib folder of the first...

You can't really configure IDEA to do this directly. While you can configure Artifacts in the Project Structure dialog, there are no provisions for copying artifacts. IntelliJ IDEA is an IDE, not a build tool. While it can do a lot regarding complying and building, it has its limits.

One possible hackish way would be to go to the Artifact definition in the project structure. There, there are "Pre-processing" and "post-processing" tabs, They have the option to run an Ant target. So you could create a simple Ant target to do the copying. But in the end, I think the best answer to your question:

Maybe a better question: What is the recommended way to manually build several artifacts in order of their dependencies?

is to use a build tool such as Ant, Maven, or Gradle for building the project.

相关问答

更多
  • 边栏链接插件有一个功能,可以在项目页面上添加自定义链接(build / general,但你想要项目)。 然后你可以设置该链接指向类似的东西 ${JENKINS_URL}/job/${JOB_NAME}/lastFailedBuild/artifact/ 另一个选项是Doclinks插件 ,它的功能基本相同。 Sidebar link plugin Has a feature that will make it possible to add a custom link on a project page ...
  • 您应该zip / tar目录并创建以下设置: http://myrepo.com:8080/artifactory/simple/myrepo/ fizz/ buzz/ 1.7/ buzz-1.7.jar resources-1.7.zip ivy-1.7.xml 在您的ivy.xml中,您可以将每个文件声明为此模块的发布,如下所示:
  • 您可以使用Flexible Publish插件来设置构建后条件。 将其配置为仅在构建成功或任何条件发生时执行“存档工件” You can use Flexible Publish plugin to setup post-build conditions. Configure it to execute "Archive Artifacts" only if build was successful or whatever your condition happens to be
  • 在配置“归档工件”时,“高级”按钮下方有一个复选框,允许您删除除最新工件之外的所有工件。 保留构建历史记录,但会删除工件。 保留最后N个版本的工件存在一个未解决的问题 - 请参阅问题834 There's a checkbox under the 'advanced' button when configuring 'archive the artifacts' that allows you to delete all but the most recent artifacts. The build hi ...
  • 我如何[配置IDEA] ...以便[它] ...创建jar文件并将其复制到第一个...的lib文件夹中... 您无法真正配置IDEA直接执行此操作。 虽然您可以在“项目结构”对话框中配置工件,但没有复制工件的规定。 IntelliJ IDEA是一个IDE,而不是构建工具。 虽然它在遵守和建设方面可以做很多事情,但它有其局限性。 一种可能的hackish方式是转到项目结构中的Artifact定义。 在那里,有“预处理”和“后处理”选项卡,他们可以选择运行Ant目标。 因此,您可以创建一个简单的Ant目标来进行 ...
  • 编写一个VS宏来执行你的工具,然后启动一个构建,这样你就可以用一个按键执行整个过程,以更快的方式进行双重构建。 或者(或与上述相结合),您可以将自定义工具添加到执行工具的VS Tool菜单中(请参阅工具 - >外部工具)。 然后在执行构建之前手动执行此自定义工具 - 这仍然是一个繁琐的双重步骤,但比构建两次更快更容易。 (并且您可能能够让您的工具在预构建步骤中运行,因此旧的双构建方法仍然有效)。 另一个选项可能是编辑项目的MSBuild脚本,以便在构建过程的早期执行您的工具,以便在依赖项扫描期间选择对文件的 ...
  • 实际上,困扰我们这么长时间的问题就在这里: 不确定我是否记得旧版本的詹金斯。 我很困惑。 Actually, the problem that bothered us for so long was in here: Not sure if I recall this in older versions of jenkins. I'm so confused.
  • 您还可以使用VCS触发器。 设置B和C将A作为快照依赖关系,D具有对B和C的快照依赖关系。然后在所有4上设置VCS构建触发器,确保选中“触发快照依赖关系中的更改”选项。 这条路 - A:A的变化被重建,然后触发B和C的构建。这些构建然后也触发D的构建,所有都按正确的顺序。 B或C中的更改:如果A未更改,则使用现有构建,重建自身并触发D的构建: D中的更改:如果A,B和C未更改,则使用现有构建并构建新的D. 我在7.1.2版本上使用此设置 It turns out that I can get what I ...
  • 问题是每个新工件都发布到同一个文件夹。 例如,1个月前我发布了WebApp1到C:\ artifacts \ WebApp1的工件,然后今天我发布了另一个转到同一文件夹的WebApp1工件。 然后保留策略启动了上个月的构建,导致它删除C:\ artifacts \ WebApp1,从而删除新工件。 令人困惑的是,如果保留策略设置为10天,“删除工件”作业可能不一定在第10天运行。在我的情况下,它花了大约30天。 我通过将构建#附加到工件名称来解决问题,以便每个工件文件夹都具有唯一的名称,例如:工件名称=“W ...
  • TeamCity无法在已停止的构建上发布,这与失败的构建不同。 停止的构建更像是一个被杀死的进程,而失败的构建是一个非零的退出代码。 相反,我建议您配置TeamCity,这样您就不必停止构建。 有两个选项可以启用: 挂起构建检测和“ 运行时间超过 ”构建失败条件。 两者都应该帮助TeamCity自动终止构建,而不是你必须停止它。 这样,您将获得失败的构建而不是停止构建,并且您的工件应该发布。 TeamCity has no way of Publishing on a stopped build, whic ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)