tag:help.appveyor.com,2012-11-13:/discussions/questions/22010-procompiling-asp-net-mvc-5-for-azure-deploymentAppVeyor: Discussion 2018-08-31T19:53:29Ztag:help.appveyor.com,2012-11-13:Comment/455118172018-06-19T18:12:25Z2018-06-25T15:44:04ZPrecompiling asp .net MVC 5 for azure deployment<div><p>I have been struggling for a while now with how to have my app precompiled to deploy on azure, I came across <a href="http://help.appveyor.com/discussions/kb/1-mvc-precompile-publish">this post</a> however the solution offered there doesn't work for me, once I add the file suggested on the post, my solution won't compile anymore, I get an error on the Integration tests project, maybe this is somehow relevant. Could you please point me in the right direction. If necessary I can provide extra info on the <code>yml</code> file</p></div>lalberto8085tag:help.appveyor.com,2012-11-13:Comment/455118172018-06-19T19:44:32Z2018-06-19T19:44:32ZPrecompiling asp .net MVC 5 for azure deployment<div><p>Can you post a configuration file and your pubxml file (please obfuscate any secrets)?</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/455118172018-06-19T20:10:04Z2018-06-19T20:10:04ZPrecompiling asp .net MVC 5 for azure deployment<div><p>Build log would help as well...</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/455118172018-06-25T15:55:26Z2018-06-25T15:55:26ZPrecompiling asp .net MVC 5 for azure deployment<div><p>here are the redacted versions of the yml and publish profile, thanks again</p></div>lalberto8085tag:help.appveyor.com,2012-11-13:Comment/455118172018-06-25T18:48:39Z2018-06-25T18:48:39ZPrecompiling asp .net MVC 5 for azure deployment<div><p>apparently the yml file got lost somehow, so here it goes</p></div>lalberto8085tag:help.appveyor.com,2012-11-13:Comment/455118172018-06-25T22:33:07Z2018-06-25T22:33:07ZPrecompiling asp .net MVC 5 for azure deployment<div><p>So then without the '.wpp.targets' file your build is successful? Is deployment also successful but just without precompilation?</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/455118172018-06-26T14:12:22Z2018-06-26T14:12:22ZPrecompiling asp .net MVC 5 for azure deployment<div><p>Yes, it works fine, I can even see that views are compiled as part of the building process and yet are deployed non-compiled</p></div>lalberto8085tag:help.appveyor.com,2012-11-13:Comment/455118172018-06-26T20:23:08Z2018-06-26T20:23:08ZPrecompiling asp .net MVC 5 for azure deployment<div><p>Sorry, I should have mentioned before that because, in your yaml configuration file, you have <code>publish_wap</code> set to true, AppVeyor will create and use a new pubxml file when it builds the project. This means that your publish profile is ignored.<br>
Please try removing your pubxml file and add the .wpp.targets file as suggested in the post you originally linked to, and add the 'PrecompileBeforePublish' element to that file.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/455118172018-06-26T20:32:56Z2018-06-26T20:32:56ZPrecompiling asp .net MVC 5 for azure deployment<div><p>One quick question here though, can I use my publish profile and still override a few things, like usernames and passwords in the yml file?</p></div>lalberto8085tag:help.appveyor.com,2012-11-13:Comment/455118172018-06-26T20:40:07Z2018-06-26T20:40:07ZPrecompiling asp .net MVC 5 for azure deployment<div><p>No, but for this I think you can use a 'parameters.xml' file to <a href="https://www.appveyor.com/docs/deployment/web-deploy/#web-deploy-parametrization">parameterize the deployment</a>.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/455118172018-06-27T16:34:36Z2018-06-27T16:34:36ZPrecompiling asp .net MVC 5 for azure deployment<div><p>I'm trying to use the <code>parameters.xml</code> to store the secure WebDeploy user password, can this be done?</p></div>lalberto8085tag:help.appveyor.com,2012-11-13:Comment/455118172018-06-28T01:03:01Z2018-06-28T01:03:01ZPrecompiling asp .net MVC 5 for azure deployment<div><p>Sorry, I misunderstood. The 'parameters.xml' file is not relevant in this case because it is used to replace values <em>after</em> deployment occurs (e.g. database connection strings).</p>
<p>To use secure password you can simply use <a href="https://ci.appveyor.com/tools/encrypt">AppVeyor 'encrypt data' tool</a> while signed in to your account and add them as environment variables as you are currently doing with gihub password.<br>
Then in deploy section you can use them as plain text (i.e. not with <code>secure:</code> key).<br></p>
<pre>
<code>deploy:
- provider: WebDeploy
password: $(azure_pwd)
username: $user</code>
</pre>
<a href="https://github.com/OwenMcDonnell/WebAppTestDeployment">Here is an example project</a> that also makes use of some <a href="https://www.appveyor.com/docs/deployment/#conditional-deployment">conditional deployment</a></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/455118172018-06-28T19:37:18Z2018-06-28T19:37:18ZPrecompiling asp .net MVC 5 for azure deployment<div><p>Hey, I'm sorry, I'm apparently not piecing it all together well. I just tried setting <code>publish_wap: false</code> and I get an error telling me there is no package to deploy. Then I set it to <code>true</code> and only set the values on your comment above and get an error telling me that there's no value set for <code>Server</code> on the <code>Providers Settings</code>.</p>
<p>What am I getting wrong here?</p></div>lalberto8085tag:help.appveyor.com,2012-11-13:Comment/455118172018-06-28T20:09:46Z2018-06-28T20:09:46ZPrecompiling asp .net MVC 5 for azure deployment<div><p>I didn't mean for my code sample above to be a complete set. <code>Server</code> is a mandatory setting, but I assumed you would just use the same from the redacted yaml you provided.</p></div>Owen McDonnell