在安装了 Beta 版的机器上运行 ASP.NET MVC 预览版 3 应用程序 - 安装 ASP.NET MVC Beta 后如何从 GAC 中删除 System.Web.Mvc?

发布于 2024-07-07 22:08:13 字数 633 浏览 6 评论 0原文

我有一个针对 MVC Preview 3(引用 MVC 程序集的本地副本)构建的应用程序,我正在尝试在安装了 ASP.NET MVC beta 的计算机上修改/测试该应用程序。 我还没有兴趣更新此应用程序以针对 MVC beta 运行 - 我只需要进行一些小更改。

它因 RouteCollection.IgnoreRoutes(在 global.asax.cs 中)上的 MissingMethodExceptions 而失败,因为在运行时,CLR 始终在 GAC 中查找 System.Web.Mvc 的 Beta 版本,并将其加载到我的站点的 \ 中,而不是加载预览版 3 版本。 bin 目录。

由于程序集具有相同的名称、版本和公钥,我相信在 web.config 中无法区分它们,因此我认为这里唯一的解决方案是从 GAC 中删除 ASP.NET MVC beta 程序集。

只是 - 我不能这样做,因为它们是由 Windows Installer 安装的,所以我无法使用 gacutil.exe /u 删除它们,并且当我尝试直接删除它们时,我收到“访问被拒绝”。

任何人都知道我如何删除此程序集 - 或者,如果失败,如何在 GAC 中具有 System.Web.Mvc beta 的系统上运行/托管需要 System.Web.Mvc 预览版 3 的应用程序?

I have an app built against MVC Preview 3 (referencing local copies of the MVC assemblies) that I'm trying to modify/test on a machine with the ASP.NET MVC beta installed. I am not interesting in updating this app to run against MVC beta yet - I just need to make a few small changes.

It's failing with MissingMethodExceptions on RouteCollection.IgnoreRoutes (in global.asax.cs) because at runtime, the CLR is always finding the beta version of System.Web.Mvc in the GAC and loading this instead of the preview 3 version in my site's \bin directory.

Since the assemblies have the same name, version and public key, I believe there's no way of distinguishing between them within web.config, so I think the only solution here is to remove the ASP.NET MVC beta assemblies from the GAC.

Only - I can't do this, because they're installed by Windows Installer, so I can't remove them using gacutil.exe /u, and I'm getting "Access is denied" when I try and remove them directly.

Anyone know how I can remove this assembly - or, failing that, how to run/host an app that needs System.Web.Mvc preview 3 on a system that has System.Web.Mvc beta in the GAC?

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

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

发布评论

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

评论(4

不醒的梦 2024-07-14 22:08:13

您可以下载 ASP.NET MVC Preview 3 源代码 并使用您自己的 SNK 对其进行编译,或者为其提供与官方版本不同的版本并在您的网站中引用该版本。

You could possible download the ASP.NET MVC Preview 3 Source and compile it with your own SNK or give it a different version as the offical one and reference that in your website.

青萝楚歌 2024-07-14 22:08:13

我认为,由于该应用程序是在预览版本上构建的,因此您最好的选择是升级该应用程序以与测试版一起使用,因为您知道最终您将必须更新它以与生产版本一起使用。 我知道这不是您想听到的,但我认为这是 CTP 版本和公开测试版的现实。

I think your best bet, since the app was built on a preview release, is to upgrade the app to work with the beta release, knowing that eventually you will have to update it to work with the production release as well. I know this isn't what you want to hear but I think it's a fact of life with CTP releases and public betas.

疯了 2024-07-14 22:08:13

Hangy 的答案似乎符合这里的要求 - 如果我们最终必须在多个工作站上维护这个应用程序,那么这正是我们要做的,直到我们有时间将代码迁移到测试版/实时版本。

但与此同时,我实际上所做的是破解注册表,以便我可以从 GAC 中删除 System.Web.Mvc - 完整详细信息发布在 我的博客。 现有代码现在正在运行,无需对 Preview 3 或 Beta 项目进行任何修改。

Hangy's answer seems to fit the bill here - if we end up having to maintain this app on multiple workstations, that's exactly what we'll do until we've got time to migrate the code to the beta/live release.

In the meantime, though, what I've actually done is to hack the registry so I can remove System.Web.Mvc from the GAC - full details are posted on my blog. Existing code is now running with no modifications to either the Preview 3 or the Beta projects.

可是我不能没有你 2024-07-14 22:08:13

根据这里的问题< /a> 和 此参考链接< 中删除注册表项

System.Web.Mvc,version="1.0.0.0",culture="neutral",publicKeyToken="31BF3856AD364E35",processorArchitecture="MSIL"

/a> 您需要从

HKEY_CLASSES_ROOT\Installer\Assemblies\Global

//Edit - Oh that's your blog lol 。 感谢您的帖子:-)

As per this question here and this reference link you need to delete the registry key

System.Web.Mvc,version="1.0.0.0",culture="neutral",publicKeyToken="31BF3856AD364E35",processorArchitecture="MSIL"

from

HKEY_CLASSES_ROOT\Installer\Assemblies\Global

//Edit - Oh that's your blog lol. Thanks for the post :-)

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