{"id":2496,"date":"2022-08-30T15:25:21","date_gmt":"2022-08-30T15:25:21","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/27\/azure-git-deployment-fails-on-referenced-config-file-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:25:21","modified_gmt":"2022-08-30T15:25:21","slug":"azure-git-deployment-fails-on-referenced-config-file-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/azure-git-deployment-fails-on-referenced-config-file-collection-of-common-programming-errors\/","title":{"rendered":"Azure git deployment fails on referenced .config file-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to deploy a simple mvc 4 project to windows azure using git. It works fine if I just publish it directly. The issue is basically in my web.config file I am referencing a MailSettings.config file for sending email like so:<\/p>\n<pre><code>\n  \n    \n  \n\n<\/code><\/pre>\n<p>I have ignored the MailSettings.config file in my git repository since it contains sensitive information. So it makes sense that the file isn&#8217;t found and I need to supply it some other way. The specific error I&#8217;m getting is:<\/p>\n<pre><code>Copying file MailSettings.config to C:\\DWASFiles\\Sites\\testsite\\Temp\\05e169ef-8e7e-4246-9197-373cf66c3575\\MailSettings.config failed. Could not find file 'MailSettings.config'\n<\/code><\/pre>\n<p>Is there is a simple way to handle this type of situation? I can upload the file separately through FTP, but how do I set up the git deployment in azure to skip the file? The git deployment is a nice feature. I appreciate any help!<\/p>\n<ol>\n<li>\n<p>If the file isn&#8217;t in your git repo, you need to remove the reference to it from your csproj file, or it won&#8217;t build. Then you can just upload the file in the wwwroot folder via FTP so it&#8217;s available at runtime.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2014-01-27 08:37:35. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am trying to deploy a simple mvc 4 project to windows azure using git. It works fine if I just publish it directly. The issue is basically in my web.config file I am referencing a MailSettings.config file for sending email like so: I have ignored the MailSettings.config file in my git repository since it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2496","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2496"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2496\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}