﻿
{"id":2682,"date":"2014-05-26T12:10:59","date_gmt":"2014-05-26T12:10:59","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=2682"},"modified":"2014-05-26T12:10:59","modified_gmt":"2014-05-26T12:10:59","slug":"cta-an-unhandled-exception-of-type-system-configuration-configurationerrorsexception-occurred-in-system-configuration-dll-hatasi-ve-cozumu","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/cta-an-unhandled-exception-of-type-system-configuration-configurationerrorsexception-occurred-in-system-configuration-dll-hatasi-ve-cozumu\/","title":{"rendered":"C#&#8217;ta &#8220;An unhandled exception of type &#8216;System.Configuration.ConfigurationErrorsException&#8217; occurred in System.Configuration.dll&#8221; Hatas\u0131 ve \u00c7\u00f6z\u00fcm\u00fc"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Bir proje \u00fczerine \u00e7al\u0131\u015f\u0131rken App.config dosyas\u0131 \u00fczerinde i\u015flemler ger\u00e7ekle\u015ftiriyordum.Projemi derleyip \u00e7al\u0131\u015ft\u0131rd\u0131\u011f\u0131m esnada h\u0131zl\u0131 bir \u015fekilde a\u015fa\u011f\u0131daki hatay\u0131 ald\u0131m.(<em>A\u015fa\u011f\u0131daki g\u00f6rselde konuyu sadele\u015ftirmek i\u00e7in farkl\u0131 bir \u00f6rnek projede al\u0131nan hata g\u00f6sterilmektedir<\/em>)<\/p>\n<p><a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2014\/05\/An-unhandled-exception-of-type.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2684\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2014\/05\/An-unhandled-exception-of-type-300x83.png\" alt=\"An unhandled exception of type\" width=\"300\" height=\"83\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2014\/05\/An-unhandled-exception-of-type-300x83.png 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2014\/05\/An-unhandled-exception-of-type.png 497w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nAl\u0131nan hata metinsel olarak a\u015fa\u011f\u0131daki gibidir.<\/p>\n<p style=\"text-align: center;\">&#8220;<span style=\"color: #ff6600;\"><em>An unhandled exception of type &#8216;System.Configuration.ConfigurationErrorsException&#8217; occurred in System.Configuration.dll<\/em><\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"color: #ff6600;\"><em>Additional information: Yap\u0131land\u0131rma sistemi ba\u015flat\u0131lamad\u0131<\/em><\/span>&#8220;<\/p>\n<p>Onca zamand\u0131r verdi\u011fin emek ve \u00e7aba \u00fczerine hi\u00e7 g\u00f6rmedi\u011fim ve \u015fahit olmad\u0131\u011f\u0131m bir hatayla kar\u015f\u0131la\u015ft\u0131m.Hay\u0131r hep kulland\u0131\u011f\u0131m App.config dosyas\u0131ndan b\u00f6yle bir hata neden alabilirdim ki?Velhas\u0131l an\u0131nda internetten aramalara ba\u015flad\u0131m.Taramad\u0131\u011f\u0131m site kalmad\u0131.Bu hatan\u0131n \u00e7\u00f6z\u00fcm\u00fc nedir bilen yok.\u015eu bir ger\u00e7ek bu hatay\u0131 do\u011fru d\u00fczg\u00fcn alan olmad\u0131\u011f\u0131 i\u00e7in en nihayetinde internettende umudumu kestim.Derken hataya bir \u00e7\u00f6z\u00fcm buldum ve \u00e7\u00f6z\u00fcmden ziyade hata sebebinin ne kadar ironik oldu\u011funu sizlere belirtmek isterim.Hatan\u0131n sebebi, ne mant\u0131ksal ne de programatik bir hata.<\/p>\n<p>A\u015fa\u011f\u0131daki sat\u0131rlarda hatam\u0131z\u0131n sebebini ve \u00e7\u00f6z\u00fcm\u00fcn\u00fc sizlere sunmadan \u00f6nce bahsetmem gereken bir husus var.Hatam\u0131z\u0131n \u00e7\u00f6z\u00fcm\u00fc App.config dosyas\u0131nda.Lakin bu hata sebebinin bana ironik gelmesinin sebebi App.config, web.config gibi konfig\u00fcrasyon dosyalar\u0131n\u0131n teknik \u00f6zelliklerine tam hakim olamamamda olabilir.Ben, bana yetecek kadar bu yap\u0131lar\u0131 biliyor ve kullan\u0131yorum.O y\u00fczden bir teknik kural ihlalinin ak\u0131betinde al\u0131nan bir hata bana \u00e7ok ilgin\u00e7 gelmi\u015f olabilece\u011finden dolay\u0131, &#8220;yi\u011fiti \u00f6ld\u00fcr hakk\u0131n\u0131 yeme&#8221; prensibinde hareket ederek &#8220;bildiklerime s\u0131\u011f\u0131narak, bilmediklerimi \u00f6rt bas edecek&#8221; kadar kendini a\u015famam\u0131\u015f bir insan olmad\u0131\u011f\u0131mdan bu durumu sizlerin bilmesini istiyorum.<\/p>\n<p>Her neyse biz konumuzda d\u00f6nelim.<\/p>\n<p>Projemizdeki App.config dosyam\u0131za bakal\u0131m nas\u0131l bir hata varm\u0131\u015f?<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;\r\n&lt;configuration&gt;\r\n  &lt;appSettings&gt;\r\n    &lt;add key=&quot;OrnekKey&quot; value=&quot;OrnekDeger&quot;\/&gt;\r\n  &lt;\/appSettings&gt;\r\n  &lt;configSections&gt;\r\n  &lt;\/configSections&gt;\r\n  &lt;startup&gt;\r\n    &lt;supportedRuntime version=&quot;v4.0&quot; sku=&quot;.NETFramework,Version=v4.5&quot; \/&gt;\r\n  &lt;\/startup&gt;\r\n&lt;\/configuration&gt;\r\n<\/pre>\n<p>Yukar\u0131daki g\u00f6rd\u00fc\u011f\u00fcn\u00fcz App.config dosyas\u0131nda bir hata var.Lakin &#8220;<strong>Nerede?<\/strong>&#8221; diye soruyor olabilirsiniz \ud83d\ude42<\/p>\n<p><span style=\"color: #ff0000;\">Hatan\u0131n sebebi<\/span>, &#8220;configSections&#8221; nodeu &#8220;appSettings&#8221; nodunun alt\u0131nda olmas\u0131d\u0131r.<br \/>\n<span style=\"color: #ff0000;\">Hatan\u0131n \u00e7\u00f6z\u00fcm\u00fc<\/span>, &#8220;configSections&#8221; nodeu &#8220;appSettings&#8221; nodunun \u00fcst\u00fcnde olmas\u0131 gerekiyor.<\/p>\n<p>Yani,<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;\r\n&lt;configuration&gt;\r\n  &lt;configSections&gt;\r\n  &lt;\/configSections&gt;\r\n  &lt;appSettings&gt;\r\n    &lt;add key=&quot;OrnekKey&quot; value=&quot;OrnekDeger&quot;\/&gt;\r\n  &lt;\/appSettings&gt;\r\n  &lt;startup&gt;\r\n    &lt;supportedRuntime version=&quot;v4.0&quot; sku=&quot;.NETFramework,Version=v4.5&quot; \/&gt;\r\n  &lt;\/startup&gt;\r\n&lt;\/configuration&gt;\r\n<\/pre>\n<p>gibi \ud83d\ude42<br \/>\nya da<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;\r\n&lt;configuration&gt;\r\n  &lt;appSettings&gt;\r\n    &lt;add key=&quot;OrnekKey&quot; value=&quot;OrnekDeger&quot;\/&gt;\r\n  &lt;\/appSettings&gt;\r\n  &lt;startup&gt;\r\n    &lt;supportedRuntime version=&quot;v4.0&quot; sku=&quot;.NETFramework,Version=v4.5&quot; \/&gt;\r\n  &lt;\/startup&gt;\r\n&lt;\/configuration&gt;\r\n<\/pre>\n<p>gibi.Yani &#8220;configSections&#8221; nodeunu silincede hata ortadan kalk\u0131yor.<\/p>\n<p>Evet, bu ironik hatan\u0131n sebep sonu\u00e7 ili\u015fkisinin basitli\u011fine de\u011finmi\u015f ve \u00e7\u00f6z\u00fcm\u00fcn\u00fc \u00f6\u011frenmi\u015f olduk.<\/p>\n<p>Bu hatan\u0131n, App.config ve web.config gibi konfig\u00fcrasyon dosyalar\u0131n\u0131n tekniksel \u00f6zelliklerine ba\u011fl\u0131 bir hata oldu\u011funu d\u00fc\u015f\u00fcn\u00fcyorum.Yani farkl\u0131 node yap\u0131lar\u0131 aras\u0131nda s\u0131rasal ili\u015fkiler olmas\u0131 art\u0131k bu konuyu okuduktan sonra pek muhtemel geliyor.Yani bir tek &#8220;appSettings&#8221; ve &#8220;configSections&#8221; nodelar\u0131 aras\u0131nda olan bir ili\u015fkiden ibaret olmayaca\u011f\u0131n\u0131 yans\u0131tmaya \u00e7al\u0131\u015f\u0131yorum ve bilmedi\u011fim bu konular \u00fczerinde teori ortaya at\u0131p en az\u0131ndan yar\u0131n benzer durumlarda(yani hatalarda) bu konuyu mant\u0131ksal a\u00e7\u0131dan ele almay\u0131 akl\u0131m\u0131n bir ucuna not al\u0131yorum. \ud83d\ude42<\/p>\n<p>Vee hepinize iyi \u00e7al\u0131\u015fmalar diliyorum&#8230;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Bir proje \u00fczerine \u00e7al\u0131\u015f\u0131rken App.config dosyas\u0131 \u00fczerinde i\u015flemler ger\u00e7ekle\u015ftiriyordum.Projemi derleyip \u00e7al\u0131\u015ft\u0131rd\u0131\u011f\u0131m esnada h\u0131zl\u0131 bir \u015fekilde a\u015fa\u011f\u0131daki hatay\u0131 ald\u0131m.(A\u015fa\u011f\u0131daki g\u00f6rselde konuyu sadele\u015ftirmek i\u00e7in farkl\u0131 bir \u00f6rnek projede al\u0131nan hata g\u00f6sterilmektedir) Al\u0131nan hata metinsel olarak a\u015fa\u011f\u0131daki&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,258],"tags":[130,27,598,260,548],"class_list":["post-2682","post","type-post","status-publish","format-standard","hentry","category-c-sharp-c","category-hata-cozumleri","tag-app-config","tag-c","tag-cozum","tag-hata","tag-web-config"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/2682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=2682"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/2682\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=2682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=2682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=2682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}