仅更新 ASP.NET 应用程序中引用的 .dll

发布于 2024-08-13 17:58:33 字数 347 浏览 7 评论 0原文

我有一个已部署的 Web 应用程序项目,该项目引用了我的 Utility.dll 类库。我想对 Utility.dll 进行更改并仅推出该 .dll。问题是,当我这样做时,当我尝试启动我的网站时出现以下错误:

无法加载文件或程序集“Utility,Version=1.0.0.0,Culture=neutral,PublicKeyToken=3766481cef20a9d1”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。 (HRESULT 异常:0x80131040)

是否有一个设置可以更改,这样我就不必推出整个 Web 应用程序项目 - 仅 Utility.dll?谢谢!

I have a deployed web application project that references my Utility.dll class library. I want to make a change to the Utlity.dll and roll only that .dll out. The problem is that when I do that, I get the following error when I try to launch my site:

Could not load file or assembly 'Utility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3766481cef20a9d1' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Is there a setting I can change so I don't have to roll out the entire web application project - only the Utlity.dll? Thanks!

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

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

发布评论

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

评论(4

救赎№ 2024-08-20 17:58:33

如果程序集的版本已更改,您可以强制将版本恢复为 1.0.0.0,

但不建议这样做。

另外,它引用了哪些程序集,以及您在更新实用程序时是否也更新了它们?

此外,如果库已签名,并且引用程序集需要签名的库,则您很可能只需更新整个项目。

If the version of your assembly has changed, you -could- force the version back to 1.0.0.0

Though this is not recommended.

Also what assemblies does it reference, and did you update them as well when you updated utility?

Also if the library is signed, and the referencing assembly expects the signed library, you will most likely just have to update the entire project.

○闲身 2024-08-20 17:58:33

尝试修改 web.config 文件中的 Assemblies 部分,将程序集版本更改为所需版本

Try to modify Assemblies section in the web.config file to change an assembly version to required one

旧情勿念 2024-08-20 17:58:33

网站根目录的“web.config”文件中有一个“程序集”部分。此部分存储有关所有引用的程序集的信息,并且 Web 应用程序根据此文件加载程序集。每个引用的程序集在此部分中都有一条记录,如下所示:

<add assembly="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

尝试将此记录的 Version 属性(在我的示例中其值为 7.0.3300.0)更改为必要的版本

There is an "Assemblies" section in "web.config" file in the root of your website. This section stores information about all referenced assemblies and web application loads assemblies according to this file. Every referenced assembly has a record in this section like this one:

<add assembly="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

Try to change Version attribute of this record (in my example it has value 7.0.3300.0) to the necessary version

拥有 2024-08-20 17:58:33

我修改了 web.config 文件中的程序集绑定来解决此问题。我使用了以下已经存在的示例:

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>

I modified the assembly bindings in my web.config file to fix this issue. I used the following examples that were already there:

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文