Ember, Visual Studio, and WebApi - c#

I primarily use Visual Studio, C#, and WebApi for my projects. We're looking to utilizing Ember, Ember relies heavily on Node Package Manager. Which Visual Studio does support, but is there a way to integrate Ember and their Command Line better into Visual Studio?
Currently, we would use Node and Ember for our frontend, then we would open Visual Studio and our backend code. They're currently separated, was hoping to avoid having to switch a better integration.

I have also tried myself and at the current time there are no usable plugins that help integrate ember into VS. You may use VS editor to modify the source but you wont get a lot of the build tools and extra features of VS.

I'm in the same scenario, WebApi backend + Ember client. Currently I add de ember app folder in the visual studio solution as "Existing Web Site", hide node_modules and temp windows folders and run all commands from external command line.

Related

Visual Studio 2017 Issues

So, I feel like I don't have all of the Visual Studio components that I need on my personal computer. For example, when I create a new ASP.NET application on the school computer, it generates files with it (program.cs, startup.cs, and appsettings.json), but those don't exist when I try to create a project on my laptop.
I just had a huge issue trying to get Scaffold-DbContext to work (and after about an hour of digging, finally found the commands to run in Package Manager Console that would allow that much to work). I'm sure there are other things I'm completely missing and don't realize it yet.
What do I need to do to get these files to be generated when I create a new project? Are there other things that I haven't installed for Visual Studio yet that I probably should? I'm really at a complete loss here.
Bring up Visual Studio. Click on Tools. Click Get Tools and Features...
Compare whats installed with what you have at school.
These three will do most of what your looking for:
.Net desktop development
ASP.NET and web development
Data storage and processing
Also look at the versions Help About Microsoft Visual Studio

Import Azure Function from portal into Visual Studio

I really like working with Azure functions in the portal but am starting to need some more tooling that I'm used to for committing to my git repo, easily adding assemblies, and just plain working in a more familiar environment.
Is it possible to create your Azure function app and possibly the functions themselves in the portal and then move over to Visual Studio and import that function app as a project? Or am I approaching this wrong? I understand we can create straight from Visual Studio and then publish up to Azure and maybe that is the way we should be doing it in the first place.
A few pieces you could do. You can start development in the portal and then download the app settings (connection strings, etc.) via the azure-function-core-tools with a CLI command like func azure functionapp fetch-app-settings <appName> - but that will just pull the settings into an existing local project.
You could also go to the Platform Settings tab and open the App Service Editor which would let you download the workspace as pictured below. That will download the function project into a folder you could check into source control and use with CI/CD.
However one important note is the portal for C# projects use C# script files (.csx), and the Visual Studio tools for Functions create .NET assemblies (.dll), so if using C# you wouldn't be able to download the workspace and open it up in Visual Studio - you'd likely be better off just copy/pasting the code into a Visual Studio project.
Personally since the latest v3 update of VS 2017 I find starting in Visual Studio is even more convenient than the portal was for Function apps.

How do I create an Azure Website and SQL Database programmatically?

Thanks for looking.
I have a need to be able to create new Azure website and database instances from a Windows forms application I have created as an internal-use tool.
I am not sure if there is a C# API for this or if I need to use Powershell or some other CLI, but I would appreciate any advice.
All of the searching I have done on the subject has not turned up a simple, direct explanation as to how to do this or if it is even possible.
Using Azure Resource Manager (ARM) API's is the way to go these days - especially with your scenario. You've probably seen documentation that uses the old Service Management API's to do this. You could still do this, but I would strongly discourage it. ARM is where the investment in automation is landing going forward.
For your particular scenario, there is actually a tutorial here.
If you are using Visual Studio 2013 or 2015, then you can also use the ARM templates that it provides. For example, from Visual Studio, select File > New > Project and choose the Azure Resource Group project template.
The next window in the new project dialog is where you can select from some common deployment templates, such as what you are looking for, which is a Web App + SQL Database.
This project will contain the ARM template that describes your environment and a script that you can use to invoke ARM to deploy it.
To deploy the environment, right-click on the project in Visual Studio and select Deploy. Fill in the parameters that the template provides and you are on your way. If you look in the script that is generated (Deploy-AzureResourceGroup.ps1), you will see at the bottom of the script a call to New-AzureResourceGroup. What this does is basically merge your ARM template and parameters together and then sends them to Azure Resource Manager to provision the environment. In other words, you have everything here to automate this without having to do it from Visual Studio.

Does Visual Studio Online keep a copy of my code if I create a project?

I would like to use GIT as version control on a Visual Studio 2013 project. It does however require you to create a project with Visual Studio Online. Does this mean that a copy of my code will be stored somewhere, or is the purpose of creating this project only to be allow other users to be added so that you can collaborate?
You don't have to use Visual Studio Online to use code control in Visual Studio. You can create the .git and use an external tool (like command line or source safe), or you can use the internal tool.
I think that the Visual Studio community edition struggles to create a git repo without being bound to the Visual Studio Online, but once its created, it works fine with various http remotes (I have a project here which uses two remotes, one being VSO and one being our gitlab repo that we use).
Storing your code remotely (but secured) on one of the major sites can be a major benefit to you in the long run. It gets you into good habits of committing and pushing your source, even when you're working alone.
VSO is basically a cloud-based version of TFS - Microsoft's source control, build and task management system.
In order to use the system for source control purposes, you need to use the "Check In" functionality on the Solution in the VSO project before the cloud-based version is updated. The initial project in VSO will likely be empty.
You can use VSO for collaboration but you don't have to.

Web Deployment Projects tool and Web application project

Q1 - As far as I know, Visual Studio doesn’t use aspnet_compiler.exe when compiling web application projects. And since Web Deployment Projects (WDP) tool is only used for manipulation the output created by aspnet_compiler.exe, I don’t understand how VS 2008 also has an option for using WDP with web application projects?!
Q2 - What is a stock project?
thanx
EDIT:
So I was right about the fact that Visual Studio doesn’t use aspnet_compiler.exe when compiling web application projects?
much appreciated
Web Application Projects are real projects - they really build, and produce a single assembly in the output (bin) folder, as well as any copies of referenced assemblies, etc. This is what a Web Deployment Project will package.
It's useful to keep in mind that Web Application Projects and Web Deployment Projects were the only way to create web projects until .NET 2.0 and Visual Studio 2005. In many cases, the better question will be "how do web site pseudo-projects ever work".
aspnet_compiler will compile .aspx/.ascx /.ashx etc.. files also (not just the code behinds). Visual studio does not. So if you want to precompile those files, use the Web Deployment projects and/or precompile manually.

Categories

Resources