How to run Dart code from Visual Studio? - asp.net

I'm building an asp.net website using Visual Studio 2012. I'm considering adding some dart code into it.
I'm trying to check how this thing works: I downloaded the DartVS visual studio extension, and I took a ready dart code from the web. The dart code runs fine on dartium when I run it from the dart IDE.
I copied and pasted the code to Visual Studio (that now recognizes dart thanks to the extension). When I run it from there - I could see that the GUI appears, but the buttons don't seem to work. I put a breakpoint in the dart code's main function but it doesn't seem to get there.
What am I doing wrong?
Thanks!

Edit: Although not full Visual Studio, I have created a VS Code extension that does support debugging here.
I'm the author of the extension you linked. Currently, there is no debug support. If you're going to launch from VS in the browser, you'll need to add Dartium to the list of browsers in Visual Studio.
The current version of the extension is very limited and just uses regular expressions to syntax highlight and runs the command-line Analyzer for error info. Both of these kinda work; but have some flaws.
I'm working on a new version; which is backed by a service written by Google, which has very reliable syntax highlighting, tooltips, GotoDefinition, code-completion and more. It's not ready for testing quite yet; but it'll be pushed as an update to the extension you already have once it's done.
The plan is to ultimately include Visual-Studio debugging; but for now, I'd recommend using Dartium and debugging in the developer tools.

When you run the code from VS - where does it get executed? Dart is only supported in Dartium so far - so if you want it to work in any browser, you have to use dart2js for now.
I don't know what that Extension does but this might be the problem.
Regards, Robert

You can start pub serve and Dartium manually and point Dartium to the URL pub serve listens to.
DartEditor also launches pub serve for this.
I don't know if your extension has any debugging support but in Dartium you can debug Dart and JavaScript code like JavaScript code in the normal Chrome browser dev-tools.

Related

VSIX with IWizard extension debug code out of sync

I am trying to figure out how my VSIX project stopped working [VS2022]. following this article, I was able to run and debug my VSIX project with an IWizard implementation. Something changed, I'm not sure what. I can F5-run and everything works but the code executing is not the latest code and I'm unable to hit any breakpoints (VS says No Symbols have been loaded for this document). I can tell its not the latest code because of the debug console messages and the UI is an older version.
I've tried a number of things including
Clean install
Made sure I'm in debug
Removed the extension from VS, and just tried running debug from VS
Verified compiled output is in AppData\Local\Microsoft\VisualStudio\17.0_c281014fExp\Extensions\ {myextension}
Property settings are set
Assets have not changed
I did mess around adding additional install targets but I don't think this caused any issues
Any ideas how the the project can be out of sync with the code?
I could go back to the start and implement a new project but hoping someone out there can help resolve this issue. Appreciate the help.
I figured this out. I don't know why it works the way it does, but this definitely fixed the problem.
I removed ALL extensions from VS using the extensions manager interface. So, all old instances are gone (but are they?)
In my VSIXProject I would do a clean solution, rebuild, run. I verified that the latest DLL's were being output to
C:\Users{user}\AppData\Local\Microsoft\VisualStudio\17.0_c281014fExp\Extensions{username}\Acme Project Template\1.0\VSIProject1.dll - VS Build output went here
In the debugger, when my little windows form loaded, I could tell it was old code and caught the reference in the output windows that it was loading an older version of the package.
C:\Users{user}\AppData\Local\Microsoft\VisualStudio\17.0_c281014fExp\Extensions{username}\Multi Project Name\1.0\VSIProject1.dll - debugger loaded this
C:\Users{user}\AppData\Local\Microsoft\VisualStudio\17.0_c281014fExp\Extensions{username}\Acme Project Name\1.0\VSIProject1.dll - debugger loaded this after deleting above
C:\Users{user}\AppData\Local\Microsoft\VisualStudio\17.0_c281014fExp\Extensions{username}\Acme Project Template\1.0\VSIProject1.dll - VS Build output went here
After I deleted all the previous extensions in file explorer and re-ran my project, the right code executed and debugging was enabled. IDK why the older versions were picked during debugging but it's fixed. HTH someone.

Visual Studio 2012 ASP.NET bundling fails part way through

I'm trying to setup VS 2012's new bundling functionality (via the Microsoft.Web.Optimization package - read more here) and for the most part, everything is working alright. The problem is that the processing just gives up after ~15000 characters.
When I build and run the page, I get a bunch of failures because the JavaScript files that have been loaded are truncated halfway through a line in the middle of a function...
Has anyone else experienced this or does anyone have any insight into how resolve this issue?
--UPDATE--
I originally encountered this error using foo.AddDirectory("~/scripts/", "*.js"). Using foo.AddFile("~/scripts/bar.js") only results in the javascript errors when I include any jquery plugins. No errors are being thrown on the server.
--UPDATE2--
The problem was a result of the Web Optimization library not being up to date. I highly suggest that anyone attempting to use this retrieve the library via NuGet command line: Install-Package -IncludePrerelease Microsoft.AspNet.Web.Optimization. There are various versions of documentation and examples on the web, but the most current can be found using the above method and the most current documentation is that found in the answer below.
Do you have a small repro? My guess is that maybe there's an issue with the javascript files that are in the bundle.
Its also possible the minifier is choking on something and/or incorrectly minifying them.
If you are using the Scripts.Render helper, have you tried running with debug = true to make sure that everything works correctly with no bundling or minification?
Here's also the latest documentation which might be helpful: http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification

Is it possible to get AMD APP Profiler working with C#/Cloo?

Does anyone know how/if it's possible to get AMD APP Profiler working on C# projects using the Cloo opencl library? I can run sprofile on my .NET app but even though it runs correctly no results are outputted.
Edit: Heh, it does work I just had some dodgy OpenCL code causing the display driver the crash. Just run sprofile from the command line like it describes in the help files then open it using the panel in VS2010.
As you discovered, the recommended method for using APP Profiler on a C# application is to use the command line version (sprofile.exe), and then import the results into the Visual Studio plugin after the fact.
The upcoming CodeXL product (currently in public beta) will allow you to profile a C# application directly from the standalone UI. See http://developer.amd.com/tools/hc/CodeXL/pages/default.aspx for more information on CodeXL.
Chris

Plugin like CSS-X fire for other IDEs

I'm using the PhpStorm IDE, and it has a wonderful plugin called CSS-X fire that integrates with firebug: whenever I make changes in the CSS via Firebug, and the PhpStorm project is open, the plugin makes PhpStorm aware of the cahnge, and enables me to apply it in the code.
My question is if there is a similar plugin for other IDEs (such as Visual Studio) or editors (such as Notepad++), since I'm not sure we're going to buy PhpStorm, and we also have projects not in PHP.
Have a look at cssUpdater. It is a CSS-X-Fire spin-off that works directly on selected files rather than communicating with the IDE.
Using CssUpdater with Visual Studio 2012 worked great for me. You only need to install firefox addon CssUpdater and sync the files you are going to work on.

Debugging Mojo for Palm Pre with Eclipse & Aptana

I'm pretty new to Eclipse and Mojo (.NET guy). I'm having difficulty debugging. I can set breakpoints and switch to the "Debug" Perspective, but no matter what I can do (I am running in debug mode), I can't seem to get the IDE to stop at a breakpoint in the emulator. I'm sure it's a pretty newbie mistake with Eclipse. Anyone have a good step by step I can follow.
Currently, there is no way to set a breakpoint in eclipse for use with the palm emulator.
As Gtompson83 mentioned, all we've got to work with is the gdb-style command line debugger that is included with the SDK.
Yes it's a pain.
I find it easier to attach to the emulator via ssh (scroll down to "Debugging" section) to view logging, and then just using logging in your app to figure out what is going on.
Palm has a debugger as part of the command line tools. You can set break points and check variables.
Debugger Info
I like using the Ares Debugger/Logger. It works even for code not developed using Ares.
After starting the debug mode in Eclipse (changed debug config for the app to have checked the checkboxes for Inspectable and Mojo debugging),
launch the following URL in your browser (I've had the best results with Google Chrome):
http://ares.palm.com/AresDebug/ (you can use also AresLog for logger)
For AresDebug you may need to adjust the Script Filter to start with whatever your appinfo.json file has for the "id" value, then press Get Scripts. Then you're basically good to go. You can select another *.js file and set breakpoints, etc.

Resources