[英]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.