简体   繁体   English

使用时找不到组装错误 <codeSubDirectories> 在web.config中

[英]Unable to find Assembly error when using <codeSubDirectories> in web.config

I have a web site that uses the both c# and vb.net in the app_code section. 我有一个在app_code部分中同时使用c#和vb.net的网站。 The different languages are separated into their own folder and correctly configured in the web.config. 不同的语言被分为各自的文件夹,并在web.config中正确配置。

<codeSubDirectories>
    <add directoryName="BasicCode"/>
    <add directoryName="CSharpCode"/>
  </codeSubDirectories>

This works fine 95% of the time. 95%的时间都可以正常工作。 In production using 2 load balanced servers I sporadically receive an error message along the lines of: 在使用2个负载平衡服务器的生产环境中,我偶尔会收到以下错误消息:

"Unable to find assembly 'App_SubCode_BasicCode.xxx, Version=0.0.0.0, Culture=netural, PublicKeyToken=null'. “无法找到程序集'App_SubCode_BasicCode.xxx,版本= 0.0.0.0,文化=网络,PublicKeyToken =空”。

The site is hosted in IIS7 and I think it has something to do with the name of the dll assigned during dynamic compilation. 该站点托管在IIS7中,我认为它与动态编译期间分配的dll名称有关。 I do not see this problem in a single server environment. 我在单个服务器环境中没有看到此问题。 Could this be because when the session is balanced to the second server the dynamic compiled dll name is different? 可能是因为当会话与第二台服务器平衡时,动态编译的dll名称不同吗?

It's entirely possible that the two different servers are generating different names for the dynamic assemblies; 完全有可能两个不同的服务器为动态程序集生成不同的名称。 in fact I think that's probably a dead cert. 实际上,我认为那可能是一个死证书。

The question, however, is why is one server producing an assembly name that the other one is then trying to use? 但是,问题是,为什么一台服务器生成另一个然后要使用的程序集名称? With a bog standard load balanced Asp.Net site you'd never see this. 使用沼泽标准负载平衡的Asp.Net网站,您将永远不会看到这一点。

Are there any types defined in the website code that then get serialised (either to viewstate or to a shared session state)? 网站代码中是否定义了任何类型然后将其序列化(查看状态或共享会话状态)?

If so, then this could be the problem - one server dehydrates an object from one dynamic assembly, and the other tries and fails to hydrate it because it's version is a different name. 如果是这样,则可能是问题所在-一台服务器从一个动态程序集中对一个对象进行脱水处理,另一台服务器尝试对该对象进行脱水处理,因为该版本的名称不同而无法进行脱水。

That said, I think I'd expect to see a TypeLoadException rather than one relating to Assembly Loading if that were the case. 就是说,我想我希望看到的是TypeLoadException,而不是与程序集加载有关的类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .net 4.0 web.config无法在GAC中找到程序集 - .net 4.0 web.config unable to find assembly in GAC 在web.config中使用httpErrors时未命中错误控制器 - Error controller not hit when using httpErrors in web.config 在TeamCity上偶尔出现错误“无法将配置保存到文件&#39;... \\ web.config&#39;” - Occasional error “Unable to save config to file '…\web.config'” on TeamCity 实体框架无法在嵌套的web.config中找到连接字符串 - Entity Framework unable to find connection string in nested web.config 使用自定义部分时,为什么必须在我的app.config中指定程序集而不是为web.config指定程序集 - Why do I have to specify the assembly in my app.config but not for my web.config when using custom sections 在web.config上注册一个控件程序集 - Register a Control assembly on web.config 尝试读取Web.config Config部分时发生转换错误 - Cast Error when trying to read Web.config Config Section 无法使用RSA加密方法加密web.config文件 - unable to encrypt web.config file using RSA encryption method IIS 无法读取 web.config,消息中没有错误详细信息 - IIS unable to read web.config, no error details in message web.config配置错误 - web.config configuration Error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM