臭名昭着的大会绑定错误

我真的需要帮助,因为我失去了改正问题的希望。

我正在使用Office Communications Server 64位库。 有3个DLL我在项目中使用,Microsoft.Rtc.Collaboration.dll,Microsoft.Rtc.Internal.Media.dll和SIPEPS.dll。 我不确定有关Microsoft.Rtc.Collaboration,但是Internal.Media和SIPEPS都是x64。 在GAC汇编列表中,Rtc.Collaboration在处理器架构下显示MSIL,其他显示AMD64。

我的项目编译没有错误的这些引用,但在运行时我收到错误:

无法加载文件或程序集“Microsoft.Rtc.Internal.Media”或它的一个依赖项。 试图加载格式不正确的程序。

我尝试编译CPU设置为任何CPU的项目,但没有任何更改。 在x64和x86设置下,我收到这个错误。

任何帮助表示赞赏。

更新:下面是程序集绑定日志。

=== Pre-bind state information === LOG: User = CONTOSO\elodie LOG: DisplayName = Microsoft.Rtc.Internal.Media (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: Microsoft.Rtc.Internal.Media | Domain ID: 9 WRN: A partial bind occurs when only part of the assembly display name is provided. WRN: This might result in the binder loading an incorrect assembly. WRN: It is recommended to provide a fully specified textual identity for the assembly, WRN: that consists of the simple name, version, culture, and public key token. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. LOG: Appbase = file:///C:/Users/elodie/Documents/Visual Studio 2010/Projects/TFS/proto/Main/Source/WebBot.Web/ LOG: Initial PrivatePath = C:\Users\elodie\Documents\Visual Studio 2010\Projects\TFS\proto\Main\Source\WebBot.Web\bin Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Users\elodie\Documents\Visual Studio 2010\Projects\TFS\proto\Main\Source\WebBot.Web\web.config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/e3d82f59/764fa8c3/Microsoft.Rtc.Internal.Media.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/e3d82f59/764fa8c3/Microsoft.Rtc.Internal.Media/Microsoft.Rtc.Internal.Media.DLL. LOG: Attempting download of new URL file:///C:/Users/elodie/Documents/Visual Studio 2010/Projects/TFS/proto/Main/Source/WebBot.Web/bin/Microsoft.Rtc.Internal.Media.DLL. ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated. 

我有ASP.NET IIS的这个问题,并尝试了一切后,我启用了我的应用程序池32位,并重新启动应用程序池。 然后它的工作。

在IIS7pipe理器中:应用程序池 – > DefaultAppPool – >高级设置 – >将“启用32位应用程序”设置为true。

还要确保select了正确的.Net版本。

我也将ISAPI 64bit设置为允许“ISAPI和CGI限制”,但我不确定是否有帮助。

在我的情况下,我得到了这个问题,因为我正在运行使用IISExpress编译为x64的Web项目。 我通过在Visual Studio中检查以下设置来解决此问题:

工具| 选项| 项目和解决scheme| Web项目| 使用IIS Express的64位版本

希望这可以帮助其他人解决这个问题

用32位版本replace所有三个dll的64位版本,清理Temporary ASP.NET文件夹并重新编译。 现在工作没有问题。 谢谢您的帮助。

尝试在解决scheme资源pipe理器中为这些程序集设置“复制本地”,并确保将它们放入绑定日志中指定的文件夹中。

而且,它们可能是使用V2 CLR构build的。 如果他们是,你必须启用混合模式绑定通过添加到您的networking/应用程序configuration

 <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0"/> </startup> </configuration> 

我知道这是一个老问题,但在Visual Studio中寻找关于部分绑定错误的解决scheme时似乎仍然是一个受欢迎的结果。 我遇到了与原始海报非常类似的问题,但是在EntityFramework.dll和Visual Studio 2015(.ASP Web Forms项目)中,我发现的解决scheme涉及广泛的问题。 由于我没有find类似于我的解决scheme的答案,所以我认为可能有助于贡献我发现的内容,并且希望它能帮助某人。

在我的web.config我模拟一个域用户是一个服务帐户。 此服务帐户无权访问我的临时文件文件夹,因此在debugging时无法将dll复制到此处,因此无法加载它们。

最后发现我们正在去看看错误信息中提到的临时文件夹。 在上面的原始问题中,您会注意到“试图下载新的URL文件:/// C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET文件…”当我查看在该文件夹中,我的DLL不在那里。

我的解决scheme是这样的:因为我使用64位环境,并冒充域帐户,我将域服务帐户用户添加到我的本地C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET文件文件夹与写入(和修改 – 为了好措施)访问。

底线 – 确保您的临时文件文件夹授予您的应用程序运行的用户的写入权限。

为了解决这个问题,我通过运行以下命令并检查结果来确保所有项目都使用相同的版本:

 update-package Newtonsoft.Json -reinstall 

最后,我从web.config中删除了以下内容:

  <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> </dependentAssembly> 

尝试从Visual Studio运行Web应用程序时出现错误,但在我的情况下,答案很简单。 当我仔细阅读例外情况时,我可以看到有问题的程序集已经不再被应用程序使用,但是副本仍然在bin文件夹中。 犯罪集会被删除后,错误消失了。

在我的情况下,我已经通过我的网站,并用一个新名称replace网站的名称。 我无意中用指定程序集名称的Web.config中的“NewWebSiteName”replace了“PreviousWebSiteName”。

  <pages enableSessionState="false" enableViewStateMac="true" enableEventValidation="true" controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"> <controls> <add assembly="NewWebSiteName" namespace="App_Code.Controls" tagPrefix="blog" /> </controls> </pages> 

该网站仍在build立一个旧名称的程序集 – 我只是打算改变它出现在网站页面上的网站名称; 我不需要在内部改变任何东西。 在命名更改之前恢复Web.config条目(导致匹配构build程序集名称的条目)为我解决了错误。

在我的情况下,我有一些垃圾在我的web.config,特别是一半的httpHandler注释,一旦我清理,我的绑定问题消失。