{"id":399,"date":"2005-09-08T18:07:14","date_gmt":"2005-09-08T10:07:14","guid":{"rendered":"http:\/\/blog.axqd.net\/?p=399"},"modified":"2005-09-08T18:07:14","modified_gmt":"2005-09-08T10:07:14","slug":"bug-in-enterprise-library","status":"publish","type":"post","link":"https:\/\/blog.axqd.net\/?p=399","title":{"rendered":"Bug in Enterprise Library"},"content":{"rendered":"<p>TNND\uff0c\u6700\u8fd1\u5728\u7528Enterprise Library\u7684\u65f6\u5019\uff0c\u9700\u8981\u81ea\u5df1\u5b9e\u73b0\u4ed6\u7684IAuthorizationProvider\u63a5\u53e3\uff0c\u7136\u540e\u5728\u7528\u4ed6\u7684\u914d\u7f6e\u5de5\u5177\uff08EntLibConfig.exe\uff09\u8fdb\u884c\u914d\u7f6e\u7684\u65f6\u5019\uff0c\u8001\u662f\u63d0\u793a\uff1a<\/p>\n<p>The type name XXX is not valid.<\/p>\n<p>\u4f46\u662f\u6211\u770b\u4e86\u51e0\u767e\u904d\uff0c\u8fd8\u662f\u89c9\u5f97\u5e94\u8be5\u5b9e\u73b0\u65b9\u5f0f\u6ca1\u6709\u4ec0\u4e48\u95ee\u9898\u3002\u597d\u5728Enterprise Library\u5e26\u6709\u6e90\u7801\uff0c\u6211\u76f4\u63a5\u628a\u4ed6\u914d\u7f6e\u5de5\u5177\u7684\u4e0b\u9762\u884c\u6ce8\u91ca\u6389\uff1a<\/p>\n<p>\/\/ errors.Add(instance, name, SR.ExceptionTypeNotValid(typeName));<\/p>\n<p>\u4e8e\u662f\u4e00\u5207\u4f7f\u7528\u6b63\u5e38\uff0c\u8bf4\u660e\u786e\u5b9e\u6ca1\u6709\u95ee\u9898\u3002\u4f46\u5fc3\u4e2d\u603b\u662f\u4e0d\u723d\u3002<\/p>\n<p>\u4eca\u5929\u5728\u7f51\u4e0a\u7ffb\uff0c\u7ec8\u4e8e\u53d1\u73b0\uff0c\u679c\u7136\u662f\u5fae\u8f6f\u7684\u4e00\u4e2abug&#8230;.<\/p>\n<p>The problem is that some of the configuration settings have the [TypeValidation] attribute, which will attempt to check that the assembly qualified name of the type is a valid type. Unfortunately, this is running in an App Domain which is rooted in the EntLibConfig.exe directory, and so will only be able to resolves types in assemblies in that directory, or in the GAC.<\/p>\n<p>\u800c\u4e14\u63d0\u4f9b\u7684\u6682\u65f6\u89e3\u51b3\u65b9\u6848\u5c45\u7136\u5c31\u662f\u76f4\u63a5\u6ce8\u91ca\u6389\u90a3\u4e00\u884c\uff0c\u4ed6\u8fd8\u53cb\u60c5\u63d0\u9192\uff0c\u56e0\u4e3a\u6ca1\u6709\u68c0\u6d4b\uff0c\u81ea\u5df1\u6ce8\u610f\u7c7b\u578b\u4e0d\u8981\u5f04\u9519\u4e86- &#8211;<\/p>\n<p>\u5509&#8230;\u90c1\u95f7- &#8211;<\/p>\n<p>\u6240\u4ee5\uff0c\u5982\u679c\u786e\u5b9e\u4e0d\u60f3\u6539\u52a8\u6e90\u7801\uff0c\u53ef\u4ee5\u76f4\u63a5\u628a\u751f\u6210\u7684DLL\uff0c\u7528\u751f\u6210\u540e\u4e8b\u4ef6copy\u5230EntLibConfig.exe\u76ee\u5f55\u4e0b\u5c31\u884c\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TNND\uff0c\u6700\u8fd1\u5728\u7528Enterprise Library\u7684\u65f6\u5019\uff0c\u9700\u8981\u81ea\u5df1\u5b9e\u73b0\u4ed6\u7684IAuthorizationPr &hellip; <a href=\"https:\/\/blog.axqd.net\/?p=399\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cBug in Enterprise Library\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-399","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/blog.axqd.net\/index.php?rest_route=\/wp\/v2\/posts\/399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.axqd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.axqd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.axqd.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.axqd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=399"}],"version-history":[{"count":0,"href":"https:\/\/blog.axqd.net\/index.php?rest_route=\/wp\/v2\/posts\/399\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.axqd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.axqd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.axqd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}