-
Notifications
You must be signed in to change notification settings - Fork 10.3k
On Premise TFS publish guidance #1510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, I am also facing the same issue using VSO Hosted build agent. Can you someone please help? |
Since we will see some changes to the whole build process before RTM, I suspect they aren't looking too hard at this at the moment. So, I cobbled together a solution that I hope will still mostly work after the move back to MSBbuild. It's convoluted and smells bad to me, but it does work well enough for now. I'm sure it can be optimized, but after trying so many permutations of MSBuild, VS Build, dotnet commands, etc, and finally having found a combination that works, I'm afraid to mess with it too much more at this point. One thing of note: with the new IIS hosting model for Core applications, it seems that I can't just overwrite website files as I was able to before. I believe this is because Core sites operate very much like regular applications now, so any .exe or .dll in the directory is now "in use" by IIS when the web site is running. That makes any file copy operations to update the site fail. To deal with that, I added some powershell scripts to stop and later restart the particular web site that we're updating. Also, in terms of prerequisites for my method, on the build machine I have the CORE SDK (and Visual Studio Community)installed. I don't know if the VS install is required, but I would think not as long as you have the SDK installed. YMMV. Finally, I had to slightly modify my project.json to defeat various "command not found" (path related, I'm sure) errors during build. I also had to add some switches in there to suppress NPM warnings which would fail the build regardless of how I redirected the output inside of powershell (i.e.
And, here is the whole TFS lot (each bullet point corresponds to one task in the image):
Source is *$(system.DefaultWorkingDirectory)\your_preferred_build_output_directory* and destination folder is obviously your physical IIS directory on the target machine(s).
Script contents is:
That's it. One final note, depending on what location you copy the Start/StopWebsite.Ps1 files to, you may or may not need to add a clean up task to take care of those files on the remote server. If you make improvements to this procedure, I would appreciate it if you posted your findings. I scratched out enough time to make it work well enough for now, but I wouldn't call this prime-time ready, so improvements would be welcome! Hope it helps. |
This issue is being closed because it has not been updated in 3 months. We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate. |
* React to latest CoreFxLab changes
Is there any guidance on how to publish an ASPNET Core project using an on-premise TFS server?
We had it working for RC1 using the following:
With the changes to project structure (migrating to MSBuild, etc), do we need to make changes to this process? In particular is the prebuild.ps1 script still needed?
Are there MSBuild commands/switches to handle this process more gracefully?
The text was updated successfully, but these errors were encountered: