简体   繁体   English

.NET Web发布后缺少dll

[英]dlls missing after publishing .NET Web

My web project use .NET Framework 4.7.2 and use some references like 我的Web项目使用.NET Framework 4.7.2并使用一些参考,例如

  • System.IO
  • System.Net
  • System.Net.Http
  • System.Net.Http.Formatting

My project works perfectly in local. 我的项目在本地完美运行。 However, when I publish my web project on a target directory (for online), and look what it contains in /bin/ : 但是,当我将Web项目发布到目标目录(用于在线)并查看/bin/包含的内容时:

  • System.IO is missing 缺少 System.IO
  • System.Net is present System.Net存在
  • System.Net.Http is missing System.Net.Http 丢失
  • System.Net.Http.Formatting is present 存在System.Net.Http.Formatting

Therefore, when I use my website, I get the obvious error Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. 因此,当我使用我的网站时,出现明显错误: Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

All references have Copy Local = True in Properties but some dll are always ignored. 所有引用的“ Properties均为“ Copy Local = True ,但某些dll始终被忽略。 If i copy the dlls from local directory to target directory i get the error Server Error in '/' Application. Cannot load a reference assembly for execution. Exception Details: System.BadImageFormatException: Cannot load a reference assembly for execution. 如果我将dll从本地目录复制到目标目录,则会Server Error in '/' Application. Cannot load a reference assembly for execution. Exception Details: System.BadImageFormatException: Cannot load a reference assembly for execution.收到错误Server Error in '/' Application. Cannot load a reference assembly for execution. Exception Details: System.BadImageFormatException: Cannot load a reference assembly for execution. Server Error in '/' Application. Cannot load a reference assembly for execution. Exception Details: System.BadImageFormatException: Cannot load a reference assembly for execution. Exactly the same problem as this one. 与此完全相同的问题。 However the delete/rebuild solution, or adding compilation options solution, doesn't work for me 但是,删除/重建解决方案或添加编译选项解决方案对我不起作用

What do I need to do to get these missing dlls to the destination folder? 我需要怎么做才能将这些丢失的dll放入目标文件夹?

Go to Solution Explorer on VS, open references tree, right click on the library(dll) and select properties on the menu. 转到VS上的解决方案资源管理器,打开引用树,右键单击library(dll)并在菜单上选择属性。 On properties box Copy Local should be True 在属性框上, “本地复制”应为True

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

相关问题 发布ASP .NET Web项目后项目的dll丢失 - Project`s dlls missing after publish asp .net web project 仅在发布之后:将DLL添加到ASP.Net空Web应用程序生成的文件无法加载文件或程序集“名称”或其依赖项之一 - Only after publishing: adding DLLs to ASP.Net Empty Web Application generates could not load file or assembly 'Name' or one of its dependencies 在Visual Studio 2012中发布Web应用程序后,文件夹丢失 - Folders are missing after publishing web-application in visual Studio 2012 Dll 在发布后立即丢失。 .net WinForms - Dll is missing right after publishing it. .net WinForms 使用Visual Studio 2010进行部署/发布时,某些dll丢失 - Some dlls go missing during deployment/publishing with Visual Studio 2010 asp.net Web应用程序,发布后找不到嵌入式资源 - asp.net web app, embedded resource not found after publishing 由于缺少project.json中的引用,因此无法在VS 2015中发布.Net核心Web App - Publishing .Net core Web App in VS 2015 not working because of missing references in project.json 发布 Windows Forms .NET 应用程序后缺少 SQLite.Interop.dll - SQLite.Interop.dll missing after publishing a Windows Forms .NET application 在ASP.NET IIS服务器中发布后编辑Web.Config - Edit Web.Config after publishing in asp.net IIS server .net Web服务参考发布时更新 - .net web service reference update while publishing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM