I spent about 3 days installing TeamCity to create and publish an asp.net-5 project. Finally, I did this using the dnu publish command to publish the site. I use a batch file to do this with the following commands
// stops the apppool for 'samplesite' overvise it returns exception // The process cannot access the file '...' because it is being used by another process call "%windir%\system32\inetsrv\appcmd" stop apppool "samplesite" // publish the site to the --out dir call "C:\Users\Administrator\.dnx\runtimes\dnx-coreclr-win-x86.1.0.0-beta6\bin\dnu" publish --out "F:\Sites\samplesite" --runtime dnx-clr-win-x86.1.0.0-beta6 // copies the 'prod' config.json copy "..\..\build\configuration\samplesite\config.json" "F:\Sites\samplesite\approot\src\samplesite\config.json" /Y // copies the 'prod' web.config copy "..\..\build\configuration\samplesite\web.config" "F:\Sites\samplesite\wwwroot\web.config" /Y // starts the apppool for 'samplesite' call "%windir%\system32\inetsrv\appcmd" start apppool "samplesite"
Questions
- Can I return errors / exceptions from the
dnu publish command to indicate that the publication failed? For example, I can get an exception when posting- The process cannot access the file ..... or
- The path length cannot exceed 260 characters ...
BUT the result of TeamCity build will be shown as Success , so I always need to check that it is really finished without any exceptions.
- Is there an even better way / script to publish an asp.net-5 site? Maybe I'm just doing something wrong.
c # asp.net-core teamcity dnu
AntonS Sep 01 '15 at 18:07 2015-09-01 18:07
source share