Note that there are some explanatory texts on larger screens.

plurals
  1. POFTP Credentials for MSBuild.ExtensionPack.Communication.Ftp
    primarykey
    data
    text
    <p>In my AfterBuild script I use the following method to upload the files to the deployment server:</p> <blockquote> <pre><code>&lt;MSBuild.ExtensionPack.Communication.Ftp TaskAction="UploadFiles" Host="localhost" FileNames="$(SomeFolder)\$(FileToUpload)" UserName="myUserName" UserPassword="myPassword" RemoteDirectoryName="/" /&gt; </code></pre> </blockquote> <p>How can I load these credentials from a text file or an external source? What are the alternatives? I don't want to hard-code ftp credentials into my cproj files.</p> <p>I used GranadaCoders method to answer my own question:</p> <pre><code>&lt;MSBuild.ExtensionPack.Xml.XmlFile TaskAction="ReadAttribute" File="$(FTP_Credentials_File)" XPath="/parameters/setParameter[@name='host']/@value"&gt; &lt;Output PropertyName="FtpHost" TaskParameter="Value"/&gt; &lt;/MSBuild.ExtensionPack.Xml.XmlFile&gt; &lt;MSBuild.ExtensionPack.Xml.XmlFile TaskAction="ReadAttribute" File="$(FTP_Credentials_File)" XPath="/parameters/setParameter[@name='username']/@value"&gt; &lt;Output PropertyName="FtpUserName" TaskParameter="Value"/&gt; &lt;/MSBuild.ExtensionPack.Xml.XmlFile&gt; &lt;MSBuild.ExtensionPack.Xml.XmlFile TaskAction="ReadAttribute" File="$(FTP_Credentials_File)" XPath="/parameters/setParameter[@name='password']/@value"&gt; &lt;Output PropertyName="FtpPassword" TaskParameter="Value"/&gt; &lt;/MSBuild.ExtensionPack.Xml.XmlFile&gt; &lt;Message Text="Attempting to uploade $(GeneratedZipFile) to $(FtpHost) as read from $(FTP_Credentials_File) ..." Importance="high" /&gt; &lt;MSBuild.ExtensionPack.Communication.Ftp TaskAction="UploadFiles" Condition="Exists('$(FTP_Credentials_File)')" Host="$(FtpHost)" FileNames="$(PublicFolderToDropZip)\$(GeneratedZipFile)" UserName="$(FtpUserName)" UserPassword="$(FtpPassword)" RemoteDirectoryName="/" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload