Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 为什么出站URL重写规则需要XmlSerializers.dll_Asp.net_Url Rewriting_Xmlserializer_Sgen - Fatal编程技术网

Asp.net 为什么出站URL重写规则需要XmlSerializers.dll

Asp.net 为什么出站URL重写规则需要XmlSerializers.dll,asp.net,url-rewriting,xmlserializer,sgen,Asp.net,Url Rewriting,Xmlserializer,Sgen,我试图在web.config的“重写”部分启用OutboundRules,以将所有.html扩展转换为无扩展 但是,当我添加任何规则时,不管它包含什么,我都会收到一个500错误,说明找不到.XmlSerializers.dll。请注意,出错的是数据项目,而不是web项目。一旦我删除outboundRules部分,站点就会重新开始工作 HTTP Error 500.52 - URL Rewrite Module Error. System.IO.FileNotFoundException: Co

我试图在web.config的“重写”部分启用OutboundRules,以将所有.html扩展转换为无扩展

但是,当我添加任何规则时,不管它包含什么,我都会收到一个500错误,说明找不到.XmlSerializers.dll。请注意,出错的是数据项目,而不是web项目。一旦我删除outboundRules部分,站点就会重新开始工作

HTTP Error 500.52 - URL Rewrite Module Error.

System.IO.FileNotFoundException: Could not load file or assembly '<data project>.XmlSerializers' or one of its dependencies. The system cannot find the file specified. File name: '<data project>.XmlSerializers' 
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 
at System.Reflection.RuntimeAssembly.LoadWithPartialNameInternal(AssemblyName an, Evidence securityEvidence, StackCrawlMark& stackMark) 
WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. 
所以我的假设是OutboundRules总是需要XmlSerializer,但是它总是动态生成的。在这种情况下,它无法在运行中无声地生成,因此我们得到了那个错误

那么,首先,如何使序列化程序工作?第二,为什么需要它

 Error: Cannot deserialize type 'System.ComponentModel.DataAnnotations.DataTypeAttribute' because it contains property 'DataType' which has no public setter.