Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

November 01, 2018

Microsoft Visual Studio Code with Debugger for Chrome for Static Website Pages

Hi all,

Have you used the Microsoft's free VS Code editor for you web development. I think, you should try it.

Today I'll discuss about how to debug from the VS Code without placing breakpoints on Chrome browser.

Pre-requisites


  1. VS Code should be installed
  2. Debugger for Chrome extension in VS Code


Configuring the debugger

  • Once you open your website in the VS Code
  • In the activity bar, you will find the debugger icon OR you can use the keyboard shortcut Ctrl+Shift+D
  • Now, we will "Add Configuration" to our project
  • On top of the debug sidebar, you will find an option "Add Configuration"
  • Click on "Add Configuration"
  • It will prompt you to select out of box provided options like "Chrome, NodeJS"
  • Choose Chrome
  • Now, launch.json file will be created
  • Configure the launch.json file by specifying URL with port number
  • Since, our project is of static webpages type, instead of webRoot, we will use "file"


Here is the sample launch.json file

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome for my website",
"url": "http://localhost:3001",
"file": "${workspaceFolder}/index.html"
}
]
}

Debug

  • Click on the "Start Debugging" button OR press F5
  • A new chrome window with debugging enabled will be launched
  • Place your breakpoints in VS Code, just by clicking left to the line number in the editor
  • Perform the action and your debug will be hit
  • Note: You can add conditional debugging by editing the break point


Happy debugging.

Please send your review and comments to psrdotcom@gmail.com

April 06, 2011

Compile and Execute C# (C sharp) code without Visual Studio and with .NET Framework

Hi everyone,

Today I have come across executing C# (C Sharp) code with out Visual Studio, but you must have .NET Framework installed on your computer.

Procedure:

  1. Install .NET Framework, if not installed.
  2. Set the path of the .NET Framework Edition in environment variables or by using SET PATH command.
  3. ex: C:\Windows\Microsoft.NET\Framework\v3.5
  4. Write the C# script, Save file with extension .cs
    ex: D:\csharp\trail.cs
    using System;

    public class Example
    {
        public static void Main()
        {
            Console.Write("\nIts Done\n");

            Console.ReadLine(); //Waits until user press Return
    (Enter) key
        }
    }
  5. Open command prompt, change the directory to specified folder(ex: D:\csharp\)
  6. Execute the following command
  7. cmd> csc trail.cs
  8. We will get trail.exe in the specified folder(ex: D:\csharp\), if it executed successfully
  9. Double click the trail.exe and see the output.
  10. We have successfully executed C#(C sharp) code without visual studio and with .NET Framework only
References:
http://blogs.oberon.ch/tamberg/2007-10-17/compiling-csharp-without-visual-studio.html

Please post your comments and feedback.

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com