简体   繁体   中英

Azure git deployment fails on referenced .config file

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:

<system.net>
  <mailSettings>
    <smtp configSource="MailSettings.config"/>
  </mailSettings>
</system.net>

I have ignored the MailSettings.config file in my git repository since it contains sensitive information. So it makes sense that the file isn't found and I need to supply it some other way. The specific error I'm getting is:

Copying file MailSettings.config to C:\DWASFiles\Sites\testsite\Temp\05e169ef-8e7e-4246-9197-373cf66c3575\MailSettings.config failed. Could not find file 'MailSettings.config'

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!

If the file isn't in your git repo, you need to remove the reference to it from your csproj file, or it won't build. Then you can just upload the file in the wwwroot folder via FTP so it's available at runtime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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