DestinationFiles引用 1 个项,而SourceFiles引用8个项,它们必须具有相同的项数
DestinationFiles引用 1 个项,而SourceFiles引用8个项,它们必须具有相同的项数
若以上方法解决不了:
在VS2017发布Web网站,编译的时候报错:
“DestinationFiles”引用 1 个项,而“SourceFiles”引用8个项。它们必须具有相同的项数。
如下图所示:
这种错误非常稀缺,网站找不到解决方案。唯一欣慰的是,有一台电脑居然可以编译和发布网站,并且网站解决方案是这台电脑创建的。
错误原因:
1. 不同电脑的VS开发环境不一样, VS编译生成的DLL文件缓存位置不一致导致。
2. sln解决方案文件配置有问题。
解决方案:
1. 用记事本打开xxx.sln解决方案, 整行删除 ProjectReferences 引用的DLL文件, 保存,重新打开解决方案。
xxx.sln Code:
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "CS-Framework-Web(1)", "CS-Framework-Web\", "{E12C364F-15D6-4A6A-8183-FD408215FAD0}"
ProjectSection(WebsiteProperties) = preProject
TargetFrameworkMoniker = ".NETFramework,Version=v4.0"
ProjectReferences = "{8fcfb314-7ffd-4ea1-9ede-015ccdbd19aa}|CS-Framework-BLL.dll;"
Debug.AspNetCompiler.VirtualPath = "/localhost_51984"
Debug.AspNetCompiler.PhysicalPath = "CS-Framework-Web\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_51984\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/localhost_51984"
Release.AspNetCompiler.PhysicalPath = "CS-Framework-Web\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_51984\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "51984"
SlnRelativePath = "CS-Framework-Web\"
EndProjectSection
EndProject
//来源:C/S框架网 | www.csframework.com | QQ:23404761
ProjectSection(WebsiteProperties) = preProject
TargetFrameworkMoniker = ".NETFramework,Version=v4.0"
ProjectReferences = "{8fcfb314-7ffd-4ea1-9ede-015ccdbd19aa}|CS-Framework-BLL.dll;"
Debug.AspNetCompiler.VirtualPath = "/localhost_51984"
Debug.AspNetCompiler.PhysicalPath = "CS-Framework-Web\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_51984\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/localhost_51984"
Release.AspNetCompiler.PhysicalPath = "CS-Framework-Web\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_51984\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "51984"
SlnRelativePath = "CS-Framework-Web\"
EndProjectSection
EndProject
//来源:C/S框架网 | www.csframework.com | QQ:23404761
若以上方法解决不了:
1. 删除xxx.sln解决方案文件,重新建立一个new.sln解决方案。
2. 再把原有项目全部添加进来(添加现有项目,添加现有网站)。
3. 配置和发布Web网站。
扫一扫加微信:
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网