加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 部署MVC4项目时出错:找不到文件或程序集

发布时间:2020-12-16 02:01:04 所属栏目:百科 来源:网络整理
导读:过去,我只是使用Visual Studio 2012“发布到AWS”菜单项来部署我的MVC4网站(到AWS Elastic Beanstalk). 现在,该程序在本地编译和运行,但无法部署.从消息中,它似乎正在查找当前正在部署的项目中没有的文件,也不是当前项目的引用. 在某些尝试的部署中,错误是无
过去,我只是使用Visual Studio 2012“发布到AWS”菜单项来部署我的MVC4网站(到AWS Elastic Beanstalk).

现在,该程序在本地编译和运行,但无法部署.从消息中,它似乎正在查找当前正在部署的项目中没有的文件,也不是当前项目的引用.

在某些尝试的部署中,错误是无法找到文件系统和项目中的文件. VS似乎在错误的位置搜索和不需要的文件.

Commencing deployment for project MyWebApp.UI
...building deployment package objDebugPackageArchive...
...package build 'CopyPipelineFiles': error in 'C:Program Files (x86)MSBuildMicrosoftVisualStudiov11.0WebMicrosoft.Web.Publishing.targets' at (2567,5): Copying file Contentbootstrap-fam-famcssfam-icons.css to objDebugPackagePackageTmpContentbootstrap-fam-famcssfam-icons.css failed. Could not find a part of the path 'C:MyWebAppMyWebAppMyWebApp.Model.TestobjDebugPackagePackageTmpContentbootstrap-fam-famcssfam-icons.css'.
...build of project archive failed,abandoning deployment
Commencing deployment for project MyWebApp.UI
...building deployment package objDebugPackageArchive...
...package build 'ResolveAssemblyReference': warning in 'C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets' at (1605,5): Could not resolve this reference. Could not locate the assembly "WebActivator". Check to make sure the assembly exists on disk. If this reference is required by your code,you may get compilation errors.
...package build 'ResolveAssemblyReference': warning in 'C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets' at (1605,5): Could not resolve this reference. Could not locate the assembly "WebGrease". Check to make sure the assembly exists on disk. If this reference is required by your code,you may get compilation errors.
...package build 'CopyPipelineFiles': error in 'C:Program Files (x86)MSBuildMicrosoftVisualStudiov11.0WebMicrosoft.Web.Publishing.targets' at (2185,5): Copying file Web.config to objDebugCSAutoParameterizeoriginalWeb.config failed. Could not find file 'C:MyWebAppMyWebAppAmazonobjDebugCSAutoParameterizeoriginalWeb.config'.
...build of project archive failed,abandoning deployment

我清理了项目,修复了VS2012,但错误仍然存??在!

解决方法

[编辑]
正如Jim Flanagan在评论中所建议的那样,这是一个R#(Resharper 8.2)集成问题.当R#关闭时(工具|选项| Resharper |立即暂停)部署成功. (见 http://youtrack.jetbrains.com/issue/RSRP-411186#tab=Similar%20Issues)

R#也(http://youtrack.jetbrains.com/issue/RSRP-411186)建议

turn on / off ability to use msbuild to obtain project references. You
can find such option in R#->Options->VS Integration-> Use msbuild to
obtain references

我无法在我的系统上找到该选项(没有VS Integration选项;只有“keyboard& Menus”),但在部署之前完全禁用R#就像魅力一样.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读