简体   繁体   English

VS2010 C#在构建期间缺少项目dll

[英]VS2010 C# missing project dll during build

I have problem with build in VS2010. 我在VS2010中构建有问题。 I´m trying to develop small Prism, MVVM application. 我正在尝试开发小型Prism,MVVM应用程序。

I added new project "Toolbar" to my solution "MyApp" and during the build I get following error (propably project´s dll is not created for some reason): 我在我的解决方案“MyApp”中添加了新项目“Toolbar”,在构建过程中我得到了以下错误(可能因为某些原因没有创建项目的dll):

Error 2 Could not load referenced assembly "C:\\net\\projects\\MyApp\\MyApp.Modules.Toolbar\\bin\\Debug\\MyApp.Modules.Toolbar.dll". 错误2无法加载引用的程序集“C:\\ net \\ projects \\ MyApp \\ MyApp.Modules.Toolbar \\ bin \\ Debug \\ MyApp.Modules.Toolbar.dll”。

Caught a FileNotFoundException saying "Could not load file or assembly 'C:\\net\\projects\\MyApp\\MyApp.Modules.Toolbar\\bin\\Debug\\MyApp.Modules.Toolbar.dll' or one of its dependencies. The system cannot find the file specified.". 捕获到FileNotFoundException,说“无法加载文件或程序集'C:\\ net \\ projects \\ MyApp \\ MyApp.Modules.Toolbar \\ bin \\ Debug \\ MyApp.Modules.Toolbar.dll'或其依赖项之一。系统无法找到文件指定。“

C:\\net\\projects\\MyApp\\MyApp\\ResGen MyApp C:\\ net \\ projects \\ MyApp \\ MyApp \\ ResGen MyApp

I´m quite new to VS2010 and C# so I really don´t know what happend, wheter project dll is missing because of some mistake in source code or why this can even happend? 我是VS2010和C#的新手,所以我真的不知道发生了什么,因为源代码中的一些错误或者为什么会发生这种情况,项目dll会丢失? I also don´t know how to find such a mistake in source code, because VS shows up only the error mentioned above. 我也不知道如何在源代码中找到这样的错误,因为VS只显示上面提到的错误。 Dependenies of the project should be ok i guess, file MyApp.Modules.Toolbar.dll really doesn´t exist in any folder on my hdd. 项目的依赖项应该可以,我猜,文件MyApp.Modules.Toolbar.dll确实不存在于我的硬盘上的任何文件夹中。

问题是在工具栏项目的xaml中定义的错误类名(UserControl x:Class =“BAD CLASS HERE”)。

After many googles for a similar problem where I had at one time toyed with using open office in a .net project and then all my aspx pages had the blue squiggely line saying cli_uno couldn't be found which was referenced no where and in none of my project or lib files. 经过许多谷歌搜索一个类似的问题,我曾经一次玩弄.net项目中使用开放式办公室,然后我所有的aspx页面都有蓝色的波浪线,说无法找到cli_uno,哪个没有引用我的项目或lib文件。

I deleted all the bin folders, a dll referencing it was hiding in one of them and making vs2010 freak out. 我删除了所有bin文件夹,引用它的dll隐藏在其中一个文件夹中并使vs2010变得怪异。

I realize this isn't the exact solution to the above but there isn't much out there for this error and it is a head scratcher and deleting all the bin folders worked for me so it's something to try. 我意识到这不是上面的确切解决方案,但没有太多的错误,这是一个头脑刮擦和删除所有bin文件夹为我工作所以这是尝试的东西。

You provide too litle information, so I'll ask some questions (and some possible fixes): 您提供的信息太多了,所以我会问一些问题(以及一些可能的修复):

  1. Is the file at the specified path to begin with? 指定路径上的文件是否以?开头?
  2. If not, is there a project you need to build to create the dll? 如果没有,是否需要构建一个项目来创建dll?
  3. If there is such project, does it build the .dll where yours is looking for it -- if not, you either need to copy it by hand or set up a post-build process to do the copy automatically after each build 如果有这样的项目,它是否会构建你所在的.dll - 如果没有,你需要手动复制它或者设置一个构建后的过程来在每次构建后自动进行复制
  4. If there is no such project, do you have the .dll itself somewhere. 如果没有这样的项目,你是否在某处拥有.dll。 If yes, you need to copy it to the correct location. 如果是,则需要将其复制到正确的位置。
  5. If the .dll is at the correct location, is there some protection preventing the other project to access it? 如果.dll位于正确的位置,是否有一些保护阻止其他项目访问它?

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

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