admin管理员组文章数量:1644447
A few days ago, I spend almost a day figuring out what went wrong with an application I was writing. Apparently a SerializationExeption can occur when executing ASP.NET code in the ASP.NET Development Server (Cassini).
Exception:
Type is not resolved for member ‘Classname,Assembly, Version=1.1.0.31, Culture=neutral, PublicKeyToken=null’.
Exception details:
System.Runtime.Serialization.SerializationException: Type is not resolved for member …
When executing the same website in IIS, everything runs fine.
For some strange reason the ASP.NET Development server loads the different assemblies in different ApplicationDomains, resulting in members that cannot be found.
There are different solutions to be found on the web, like inheriting your objects from MarshalByRefObject, but this can have a performance drop.
There is a simpler way in my opinion:
First of all specify the directory containing the assembly in the DEVPATH environment variable.
(Do this by opening the System Properties, properties of My Computer. At the bottom of the Advances tab page, you have a Environment Variables button. Just add the variable to your user only.)
Secondly, open the machine.config Normally you’d expect that web.config would do too, but that isn’t the case, it has to be machine.config! (This way, there isn’t any trace of this fix in theproject itself)
Add the following code:
<configuration>
<runtime>
<developmentMode developerInstallation=”true”/>
</runtime>
</configuration>
Save it, restart the ASP.NET Development server(s) and you’re good to go.
Report of the issue.
Note: there is 1 downside, sometimes, the .dll files that Visual Studio generates can get locked by Cassini. Restarting it helps.
转载于:https://wwwblogs/borllor/archive/2008/02/16/1070308.html
本文标签: 成员类型classassemblyculture
版权声明:本文标题:解决 - 未解析成员“Assembly.Class,Assembly, Version=*.*.*.*, Culture=neutral, PublicKeyToken=null”的类型。... 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1729375909a1198839.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论