Is this something Visual Studio Code needs to add or is there a way to make it work?
Visual Studio Code can provide intellisense and warnings for Meteor. To get that you simply need to add the TypeScript definition file for Meteor to your project folder. You don't need to be coding with TypeScript for this to work, it works just fine for JavaScript too.
An easy way to add that file is to use the TypeScript Definition Manager. Open a command prompt, navigate to your project folder and then type tsd query meteor --action install. That will add all the necessary bits and you should see that the Meteor specific syntax is no longer green squiggly underlined in VS Code.
If you don't yet have TypeScript Definition Manager installed there's a good guide to that in the official VS Code documentation.
There's also a lot of voices pushing for better Meteor support to be built into VS Code, it's currently the 16th most requested feature.
For those who are looking for debugging meteor app in IDE:
You can run your app in debug mode using meteor debug and then attach debugger to port number 5858, It should work for all type of node.js debuggers e.g. Visual Studio, Visual code, Webstorm etc because they all have "attach" debugger option next to "debug" option.
Jetbrains Webstorm 9 & 10 also support Meteor: http://blog.jetbrains.com/webstorm/2014/09/meteor-support-in-webstorm-9/
There was project for Visual Studio available: https://meteortools.codeplex.com/, but it hasn't been maintained for about 2 years and sadly doesn't provide any releases / downloads.
a working meteor react front end debug session
1 launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "attach to meteor",
"port": 9229,
}
]
}
note the port number is 9229
run with package.json script "debug": "meteor debug"
yarn run debug
Related
I have problem with Visual studio.
I'm developing angular 2 / Web Api (.net 4.6.1) application.
When application is starting, that visual studio freeze for ~30s and to Output console write
The source map 'data:application/json;base64,';' for file
'domain/systemjs/dist/system.src.js' could not be loaded correctly due
to an error.
Do you have experience with this?
Thanks.
I came across the same error message when investigating on why there are no symbols loaded for my breakpoints, set in TypeScript files
Problem
I used Webpack Task Runner, started in watch-mode to create the bundles.
WebpackTaskRunner started webpack with param "-d" - that caused the issue.
Solution (for me)
Remove "WebPack Task Runner" Extension from VS
Add "NPM Task Runner" - Extension to VS
Add the following npm-script to package:
"webpack-watch": "set NODE_ENV=development && webpack --color --watch"
Finally created a binding in Task Runner Explorer for "Project Open" and the "webpack-watch" script.
Using that binding, webpack is started in watch-mode (without "-d" param) after opening the project in VS.
This solved my issues (no more error messages) and the breakpoints in Typescript-Files were hit.
There's a good feature in ASP.NET core apps using Visual Studio and IIS Express that you can change the C# code and just refresh the browser to apply the change, no rebuild required.
Is there anyway to do the same in VS Code, or Command Line?
With command line, you'll have to dotnet run, change the code, Ctrl+C to shutdown server, and again dotnet run to apply the changes.
Am I missing something or is there another way to do it in Code or CommandLine what we do in Visual Studio?
You can do it VSCode as well as in commandline. If you want to use in commandline, you need to install a tool called dotnet watch. Once you install it, instead of using dotnet run you should use dotnet watch run. This will watch for changes in the file system and will compile based on the changes.
Add the following statement in project.json under tools section.
"Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final"
Execute the dotnet restore command, then you can run dotnet watch run. You can find more details dotnet watch here
And if you want to use in VSCode, you need to create a command in tasks.json file and you need to execute the task to watch. Here is the tasks.json file.
{
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": [
"${workspaceRoot}\\project.json"
],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
},
{
"taskName": "watch",
"args": [
"run"
],
"isWatching": true
}
]
}
You can use "Terminate running tasks" option in VS Code to stop this watch.
Hope it helps
I'm building an ASP.Net Core RC2 MVC Application on OS X
I don't seem to be able to set my environment for development
I think I should be able to add within my launch.json file:
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
I've tried adding it within the "name": ".NET Core Launch (web)" section. But "env" is not recognised. The version of the launch.json file is set as "version": "0.2.0", The error i get shown in the editor is Property env is not allowed
Has anyone got this working on OS X?
Thanks.
The issue is with OmniSharp for VS Code, as found at Issue #172 on their repo.
If you install their most recent preview release, the environment variable will work as intended. Download the VSIX file, and open it using the Open File dialog in VS Code. When the official release comes out, it will still suggest extension updates as per normal.
I have VS2015 and I am attempting to create an ASP.NET Core 1.0 application.
I select the template and also leave the defaults (host in azure and identity security set to individual).
I enter the details for the Azure instance and then when the project loads in VS2015 it errors straight away against DNX 4.5.1 and DNX Core 5.0. I have tried package restore but no luck. in the project.json file I have:
{
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
#Adrien got me onto the right track. I used the Nuget command line to install the latest release for Newtonsoft.Json. It successfully installed and I could see the change to the version in the project.json file. However I still had the same error displaying. Although it had updated the main file, the project.lock.json file didn't get it's references updated at the same time. I had to close my project and re-open before the reference change took effect to the lock file.
So I've been working on a asp.net core project and trying to inject scripts using the gulp-inject package. but when I try to use the gulp-inject module in gulpfile.js it throws this error in task-runner window. what am I missing here?
gulp-inject in package.json
task-runner error
This is a known issue. You need to upgrade your version of NodeJS to v4.
To see your version, open a command prompt and run:
node --version
To upgrade, go to https://nodejs.org and find the downloads or look at How do I update node and npm on windows?
If you're using Visual Studio 2015, also check the version of NodeJS that it is using. Options > Projects and Solutions > External Web Tools shows the locations. From there either:
add C:\Program Files\nodejs as the new top entry, or
move the $(PATH) to the top if it is already up-to-date.