Html+css+javascript development with Visual Studio - javascript

My main experience with developing in Visual Studio is as c#/c++ developer. But now I need to create html+css+javascript front end for [probably] PHP code, and I've heard that Visual Studio has pretty nice capabilities in that range, including debugging javascript.
However, I can't find anywhere a "web" project (except for the ASP.Net stuff, which I'm not sure that it is the right thing).
Here's what I think I need to do:
Create html file
Create css file
Include a bunch of javascript libraries
Write my own javascript code
Press F5 and debug the code in different browsers.
I'm mainly interested in intellisense, not a visual editor.
Is Visual Studio the right IDE for this kind of web development? And if it is, how do I set up the kind of project I described above?

I think the instructions at How do you add a folder to a project in Microsoft Visual Studio Express 2012 for Web? might work for setting up a Visual Studio project:
1) New blank solution
2) Right click on the solution and select Add existing website
3) Browse and select the folder with your html, css, javascript, etc. files
4) Right click on the page you want it to start on and select set as start page
As for running against different websites, you might try a Visual Studio extension. A decent starting list is here: http://www.asp.net/mobile/device-simulators

Related

How do I get Javascript onto visual studio?

My brother has been interested in learning Javascript and because Visual Studio has been a good program for me in C# I was wondering if it is possible to get Javascript onto Visual Studio. I have tried searching it up, but none of the results worked, is there a way? And if not, what are some good alternatives.
Yes you can do so by integrating javascript extension. There are project templates for js libraries (angular or react) in vs2019 for web applications when you start a new project.
https://learn.microsoft.com/en-us/visualstudio/javascript/javascript-in-vs-2019?view=vs-2019
But in all honesty, I think it is better to do js development in a ide like vs code, sublime or notepad++

Visual Studio - javascript file generation almost freeze PC - how to disable

right now I'm writing a code in Visual Studio 2017 (Community).
The code is a mix of Asp.Net, C# and Javascript (with some plugins, like jQuery, knockout, etc..)
I'm facing a very frustrating thing in visual studio that is EVERY time I modify and save a single javascript file, Visual Studio starts a generation of ALL javascript files that slows down A LOT the computer (SSD, intel i5, 8gb RAM) until it finishes, sometimes I need to wait it finish to be able to continue writing my code.
I don't know why VS do this, but I want to know if it's possible to disable it and prevent VS to generate/compile those files every time a save just one file.
Here goes an image that show what VS do:
Somebody knows what is that and what can be done to disable it?
I was having a similar issue, and disabling the language service seemed to help me.
Tools > Options > Text Editor > JavaScript/TypeScript > Language Service
Disable Language Service

Visual Studio Code Sencha Ext JS Extension Issue

I'm learning Ext JS so I installed the Sencha.vscode-extjs extension v1.0.1 in my Visual Studio Code (which is new as well, just downloaded today). I want this plugin because I saw where you can put your cursor on something like a controller and do Control+MouseClick and it will open that file. Very handy when dealing with large Ext Js apps. But I can't seem to get that feature to work. I keep seeing No definition found for 'main'...
I have verified that the extension did finish indexing everything by looking at the vscode-extjs.log file. It did take a very long time to index because I also have all the example Ext Js apps. Any idea what I'm missing? Thanks!
UPDATE: The controller is in the same folder, see image...
I think I finally figured it out. I can now Ctrl+Hover over extend, controller, requires, etc... and it will show a popup of its definition and when I Ctrl+MouseClick (or press F12) it opens that file. What I did to make it work was I opened just a single Ext JS app folder then waited for the plugin to index everything. That's it. Before, I had my entire "Projects" directory open in Visual Studio Code which contained about 8 sub folders all of which were Ext JS apps. So maybe there were naming conflicts between the different apps or maybe this plugin just wasn't intended to work with multiple apps at once.

Debugging Visual Studio web application in Release Mode

I have a Visual Studio 2013 Web Application project that breaks when in Release mode. No console errors are thrown and I think that it must have something to do with script minifying/concatenating. Everything's fine when I build in Debug Mode.
So I'm trying to figure out how to debug when in Release mode and having no luck.
Most articles, like this one, suggest modifying C/C++, Linker and other properties... but I don't have see those options, I assume because I'm working on a web app project.
Are there other ways I can enable debugging, break points, console.logs, etc in Release Mode?
If you're trying to debug a web application then no you're not going to see those options, as they're only available for C++ solutions. To debug a C# or VB web application you need shouldn't need to do any special configuration.
If it's not working however there are some simple things you can check, firstly that the PDB files are generated. These are essentially debug symbols that match the original source code up to the compiled output, allowing visual studio to step through the code and they should be placed in the same directory as your DLLs.
Once you've got your PDB in place all you need to do is attach the debugger. Now for a web application this can be a little confusing at first (if you're using IIS). IIS has several application pools:
The IIS process that you want to attatch to is called w3wp which is a little confusing at first. And potentially there are several of them (one for each AppPool that is active and running). Make sure you've got the Show processes from all users checked to see the processes listed:
To make this whole process easier, if you're running a version of Visual Studio that allows extensions take a look at AttatchTo. It adds a menu option you can click (and convert to a toolbar button/shortcut) that will automatically attach to all the IIS instances to debug your code.

Visual Studio Build Events for Javascript projects

I'd like to run a script (pre-build or post-build) when I build my jsproj from Visual Studio 2012. I've tried right-clicking the jsproj and the Solution, and going to properties but I can't find the "compile" tab or any "build events" button. Does anyone know how to do this?
You should be able to accomplish this by modifying the .jsproj file by hand, see related question How do I create a pre-build step for a javascript metro app in VS11?

Categories