从主干构建的 S#arp - Microsoft.Web.Mvc 的问题

发布于 2024-09-10 13:57:31 字数 2052 浏览 12 评论 0原文

我不确定我是否以正确的方式这样做,所以我正在寻求一些帮助...主干中有一些新功能,我想在我当前的 s#arp 项目中利用它们。

我已经从主干下载了该项目并成功运行了 go.bat 文件,然后我从“build”目录中获取了 DLL 文件并覆盖了项目“lib”文件夹中的 DLL 文件。

我的项目编译并运行良好,直到我到达使用 Microsoft.Web.Mvc 中的任何内容(例如 ActionLinkForAreas)的页面,我收到此错误:

无法加载文件或程序集“Microsoft.Web.Mvc,版本=2.0.0.0, Culture=neutral, PublicKeyToken=null' 或其依赖项之一。需要一个强名称的程序集。 (HRESULT 的异常:0x80131044)

如果有帮助的话,这是堆栈跟踪:

[FileLoadException:无法加载文件或程序集“Microsoft.Web.Mvc,Version=2.0.0.0,Culture=neutral,PublicKeyToken=null”或其之一依赖关系。需要一个强名称的程序集。 (HRESULT 异常:0x80131044)] SharpArch.Web.Areas.LinkForAreasExtensions.GetQueryStringArguments(HtmlHelper helper,Expression1操作,字符串linkText,字符串controllerUrlName,字符串actionName)在c:\ dev \ svn \sharp-jul16 \ codai-Sharp-Architecture-4d55899 \ src \SharpArch\SharpArch.Web\Areas\LinkForAreasExtensions.cs:76 SharpArch.Web.Areas.LinkForAreasExtensions.ActionLinkForAreas(HtmlHelper helper, Expression1 action, String linkText) 在 c:\dev\svn\sharp-jul16\codai-Sharp-Architecture-4d55899\src\SharpArch\SharpArch 中。网络\区域\LinkForAreasExtensions.cs:29 SharpArch.Web.Areas.LinkForAreasExtensions.BuildUrlFromExpressionForAreas(HtmlHelper helper, Expression`1 操作) 在 c:\dev\svn\sharp-jul16\codai-Sharp-Architecture-4d55899\src\SharpArch\SharpArch.Web\Areas\LinkForAreasExtensions 中。 CS:48 c:\dev\HM\app\HM.Web\Views\Profile\Index.aspx 中的 ASP.views_profile_index_aspx.__RenderContent1(HtmlTextWriter __w,控制参数Container):28 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter编写器,ICollection子项)+131 c:\dev\HM\app\HM.Web\Views\Shared\Profile.Master 中的 ASP.views_shared_profile_master.__Render__control1(HtmlTextWriter __w,控制参数Container):98 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter编写器,ICollection子项)+131 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter编写器,ICollection子项)+246 System.Web.Mvc.ViewPage.Render(HtmlTextWriter编写器)+85 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5274

谢谢。 保罗

I’m not sure if i’m doing this the right way so i’m reaching out for a little help...there are some new features in the trunk that I want to take advantage of in my current s#arp project.

I’ve downloaded the project from the trunk and run the go.bat file which succeeded, i then took the DLL files from the ‘build’ directory and overwritten the DLL files in my projects ‘lib’ folder.

My project compiled and ran fine until i get to a page which uses anything from Microsoft.Web.Mvc such as ActionLinkForAreas, I am getting this error:

Could not load file or assembly 'Microsoft.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

Here is the Stack Trace if it helps:

[FileLoadException: Could not load file or assembly 'Microsoft.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)]
SharpArch.Web.Areas.LinkForAreasExtensions.GetQueryStringArguments(HtmlHelper helper, Expression1 action, String linkText, String controllerUrlName, String actionName) in c:\dev\svn\sharp-jul16\codai-Sharp-Architecture-4d55899\src\SharpArch\SharpArch.Web\Areas\LinkForAreasExtensions.cs:76
SharpArch.Web.Areas.LinkForAreasExtensions.ActionLinkForAreas(HtmlHelper helper, Expression
1 action, String linkText) in c:\dev\svn\sharp-jul16\codai-Sharp-Architecture-4d55899\src\SharpArch\SharpArch.Web\Areas\LinkForAreasExtensions.cs:29
SharpArch.Web.Areas.LinkForAreasExtensions.BuildUrlFromExpressionForAreas(HtmlHelper helper, Expression`1 action) in c:\dev\svn\sharp-jul16\codai-Sharp-Architecture-4d55899\src\SharpArch\SharpArch.Web\Areas\LinkForAreasExtensions.cs:48
ASP.views_profile_index_aspx.__RenderContent1(HtmlTextWriter __w, Control parameterContainer) in c:\dev\HM\app\HM.Web\Views\Profile\Index.aspx:28
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +131
ASP.views_shared_profile_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\dev\HM\app\HM.Web\Views\Shared\Profile.Master:98
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +131
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +85
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5274

Thank you.
Paul

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无需解释 2024-09-17 13:57:31

保罗,
请获取最新的 master 分支。我刚刚对 SharpArch.Build 进行了更改,这将为您和其他人解决问题。解决方案:注释掉第 182 行。这是为 ILMerge 进程设置密钥文件的参数。

如果有人需要对程序集进行强命名,并且不使用区域,那么您可以取消注释该行,一切都会好起来的。

Paul,
please grab the latest of the master branch. I just made a change tot he SharpArch.Build that will solve the issue for you and others. The solution: comment out line 182. This is the argument that sets the key file for the ILMerge process.

If someone needs to have the assemblies strong named, and is not using Areas, then you can uncomment that line and all will be well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文