简体   繁体   English

更改为MSBuild部署后,ASP.NET自定义配置文件对象失败

[英]ASP.NET Custom Profile Object Fails After Changing to MSBuild Deployment

We have an ASP.NET 2.0 web forms app that used to be deployed via a web deployment project. 我们有一个ASP.NET 2.0 Web表单应用程序,该应用程序过去曾通过Web部署项目进行部署。 Recently we deployed a new version built by TFS/MSBuild and the change seems to have caused a problem with the deserialization of a custom profile object. 最近,我们部署了由TFS / MSBuild构建的新版本,该更改似乎引起了自定义配置文件对象反序列化的问题。

Here is the entry in our profile/properties section in web.config. 这是web.config中配置文件/属性部分中的条目。

<add name="MyKey" type="OurApp.UserData" serializeAs="Binary" />

This did not change as a result of the build process, nor did OurApp.UserData change. 由于生成过程,这没有更改,OurApp.UserData也没有更改。

However, when the app attempts to read the data for a given user, nothing is found. 但是,当应用尝试读取给定用户的数据时,什么也没有找到。

One obvious difference is that in the web deployment version, a single OurApp.dll was created for the web site, whereas the new version is composed of multiple, "name-mangled" assemblies. 一个明显的区别是,在Web部署版本中,为网站创建了一个OurApp.dll,而新版本由多个“名称缠结”的程序集组成。 Could that cause the profile to miss reading the properties stored in the OurApp.UserData type? 这是否可能导致配置文件错过读取OurApp.UserData类型中存储的属性?

The answer did in fact turn out to be the assembly names. 实际上答案确实是程序集名称。 After adding a aspnet_merge step to the build process and generating an assembly of the old name, all was well. 在将aspnet_merge步骤添加到构建过程并生成旧名称的程序集之后,一切都很好。

Presumedly this indicates that the profile serialization routines embed the fully-qualified class name into the binary data representing object. 假定这表明概要文件序列化例程将完全限定的类名嵌入表示对象的二进制数据中。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM