Frontend deployment ASP.NET to Azure - asp.net

I'm working with a frontend developer on a Mac ATM.
We do have a working setup where he can commit changes to CSS / cshtml files and so on to github and its automatically deployed to a deployment slot on Azure.
The major issue we are having is that everything is so slow. I could of course setup so that my frontend guy could upload files via FTP but the issue i have then is that my gulp task aren't running if he would make any changes to a CSS / LESS file or a JS file.
Is there any smart setup for this? For example that gulp could behave like it does locally and compile stuff when a file is changed. Or that you could do some sort of custom deployment where we do not build the project if there are only changes to none compiled files or something. Can i for example execute gulp task manually in Azure? I only find loads of articles on how to do it during deployment.
Or is there any ways to speed up the local -> github -> azure deployment process in general?
Sorry for so may questions in one post :)

Related

Include Css Intellisense from one project in another

I have multiple web apps running on a server that all use a lot of the same css/image files. In order make everything more centralized i've taken all of the files out of the projects and wrote a small static file server in asp.net core with some gulp tasks to manage the css. The goal was to have it act like a cdn (with only one machine) and serve some other api functions, but to work locally without internet access.
I figured that if i included the visual studio project in the solutions for my other projects they would have access to the css/scss files for intellisense, which was not the case.
Is there some way that i can reference the files in visual studio so that i can get auto completion in the apps' view files?
I solved this problem by creating a symbolic link that included the assets in the desired project.

What are the steps to deploy an Angular 2 app in a .NET Windows environment?

We are an ASP.NET shop using Windows Server, IIS, Octopus Deploy, etc. We do not use Azure.
In terms of structure and files, my Angular 2 app is very similar to this: https://github.com/DeborahK/Angular2-GettingStarted/tree/master/APM%20-%20Final%20Updated. There is no .sln file or anything like that as it is not an ASP.NET app.
What steps should I take to deploy my Angular 2 app to a server?
My guess so far is to just to run these commands on the server directly from a command window:
- npm install
- npm run lite
Or maybe try create windows service to run these commands?
You will deploy the way you normally do, but eventually what you're going to need to is to create a dist folder (or whatever you want to name it) that has all of your concat'd files / etc. This is what you'll eventually push to IIS etc. Your original Typescript / etc files of course will never get exposed.
How you get your files to a dist is up to you. You can use SystemJS, Gulp, Webpack.
I'd recommend Webpack personally. Basically nothing unusual, you just only want to expose (publically) those minified/concat specific files for Production. IIS just needs to know where they are, and how to serve the initial index.html (Also, up to you, MVC, .NET Core, etc)

Deploying a Visual Studio website vs web application

So I'm using visual studio 2010 to build a website that was formerly running on PHP, so I'm pretty new to the environment.
In starting the project I built a website project, not a web application project. I know that will probably generate a lot of "never use a website project, use a web application project instead" comments, but bear with me.
I'm attempting to provide our server team with the necessary files to compile on our server for the first time. However they're used to working with web application files, not website files.
Normally they are given the source code and a batch file that compiles the code into deployment directories and then they just move the files to the server from there. I'm pretty sure that the other teams use deployment packages to do this, which obviously isn't an option for a website.
My question is, what would be the equivalent steps for getting the source for a website ready to deploy vs a web application? I have published the website to a separate folder and this has rendered what I think is the equivalent in many ways, but I wanted to make sure.
Also, is it possible to publish certain parts of a website without others?
Please with-hold all the comments about how I should be using a web application instead, google seems to assume that's all that's used out there too.
Thanks!
There isn't much to deploying a web site other than copying the source files to a directory in IIS. It will compile the site automatically on the first page request.
I agree with Britton. I personally prefer web application but with the web site project you have 2 options.
Either a) Upload all the files (including the .vb or .cs files) and the web server will compile on the fly. OR, you can publish to a separate folder locally on your machine, and then upload that folder. I would do the publish if you don't want anyone seeing your source code.

How can I deploy ASP.NET (mvc) site using GIT and for ex. beanstalkapp.com via FTP?

The problem is, that when I commit project directory, there is uploaded everything including source code.
Not really sure why you want to upload via FTP? You shouldn't commit your own compiled binaries to source control for deployment though.
You could take a look at AppHarbor, just push your code with git and it will be build and deployed automatically.
more about AppHarbor
Real alternatives to Windows Azure PaaS (web role)?
Does it matter? Since asp.net pages can be compiled on the server, having source files on the web server is sometimes normal so IIS knows not to allow access to them.
That said, uploading output binaries into source control is generally a bad idea - it is better to do the deployment from your build server.
Actually, this is kind of hard.
For months, I've tried to automatize our deployment, without absolute success. For my experience, I can see only way to do that:
Have a build server on your deployment machine (or same network)
A build server will pull out your code from repository, say, once per minute and will check for modifications. If there's modifications, it will execute the build scripts related to this project. I suggest you to use TeamCity, because it is very easy to use compared to CruiseControl (I'm not sure if you can use Git with TFS). You can program your build server for build your solution or project and after, you can execute an msbuild script to copy the files to the production folder (e.g: c:\inetpub\yourapp or \\my_server\inetpub\yourapp). You can use MSBuild's Copy Task to do that.
UPDATE 1: I didn't tried, but if helps, you can push to an FTP server using git-ftp
UPDATE 2: Seems that some guy did some workarounds and successfully deployed his app using git and FTP.

copying ASP.NET project files with code to server

I know you can copy a Website intact to the server and have it run normally (security and compilation time aside).
What about the projects that are in the solution? [whose dll's are copied to the bin when built]. Is there a way to copy the projects' code files to the server as well?
My goal is to be able to debug [by modifying code in the project if needed] directly on the server without having to install an IDE [or keep building on dev machine and copying over dlls]. I can debug/modify the website files, but not the projects.
EDIT: to clarify, not just debug, but be able to edit.
So long as you upload both the DLLs and the PDBs, you should be able to debug successfully without the raw projects on the server. It can be augmented if you have open the matching project / solutions locally. There really isn't a requirement to upload solution, project, or raw code files to the server to debug effectively, remotely. It should be noted that breakig while debugging will hang the app domain on the target application, and as such, should be done with caution in a multiuser environment.
You do not need the project files in order to debug files.
You should read about remote debugging.
Update:
What you want to do sounds very dangerous in a production environment. If you want to develop, develop locally.
Regardless - project and solution files are organizational tools in visual studio as well as build files for the MSBuild build tool. If you don't have either visual studio or MSBuild installed on the server, there is little point in having the project and solution files on it.
Why do you need to develop on a production machine?

Resources