The project contains both c# and javascript source code. And I use visual studio 2015 (3) for the development. Since installing the TypeScipt 2.0.3 I cannot open the .js source files in editor. The message that pops up is:
An error occurred trying to load the page.
No exports were found that match the constraint:
ContractName Microsoft.CodeAnalysis.Editor.TypeScript.ScriptContexts.ITypeScriptProjectProvider
RequiredTypeIdentity Microsoft.CodeAnalysis.Editor.TypeScript.ScriptContexts.ITypeScriptProjectProvider
And it is also appearing in the TypeScript Build tab under solution properties.
Has anyone experienced the same issue or has any ideas on how to solve this? I'd like to edit the .js files in Visual Studio.
Try deleting the folder
"C:\Users\<userName>\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache"
and then restart Visual Studio. This worked for me.
Delete the following folder and restart Visual studio.
C:\Users\yourusername\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
N.B. : The AppData folder may not appear on the first place. Unhide all hidden items from View tab and then follow the path.
It seems not matter what I do, I cannot get my .ts files to compile into .js files. I have uninstalled and reinstalled Visual Studio 2017 Community and I now have VS 2017 15.2 (26430.15) and Typescript 2.2.2.0 (according to the About window inside VS).
Steps I am taking:
Open Visual Studio, File -> New Project
ASP.Net Web Application (.Net
Framework)
Select 'empty' template, add references for MVC
Add a new folder called 'Scripts'
Add a new ts file called ts1.ts
Open ts1.ts and add single line (e.g. var a = 1)
Save - no JS emitted.
Build - no JS emitted.
Ask VS really nicely - no JS emitted.
I've tried it with/without tsconfig.json and I have tried adding compileOnSave to tsconfig when I have added it.
Help?
edit: There are no build errors or warnings and I get a message in the footer saying Output(s) generated successfully.
Do you not just need to select "Show All Files" in the Solution Explorer. I have just followed your exact steps, and when showing all files, I can see the JS file, its just not automaticly added to the project.
Spot the idiot.
I had to enable 'view all files' to see the generated JS.
I can't set a breakpoint in JavaScript files in my MVC projects in Visual Studio Community 2015 Update 3. I get this error at bottom left of Visual Studio.
A breakpoint could not be inserted at this location
I can set breakpoints in C# files, but not JavaScript files.
Here is what I've done so far to troubleshoot:
checked web.config includes: compilation debug="true"
solution configuation set to "Debug"
browser is Internet Explorer
added BundleTable.EnableOptimizations = false; to BundleConfig.cs
tried adding breakpoints in both generated files during debugging as well as source code JS files when not running
Rebuilt project, restarted Visual Studio
Repaired Visual Studio
Created new projects with both .Net Framework 4.5.2 and 4.6.1
also tried all suggestions listed in this post Breakpoint Failed to Bind - Visual Studio 2015
You really can't debug a javascript code on vs2015 and below but on vs2017 its already possible. Just make sure to Enable JavaScript debugging for ASP.NET by going to Debug>Debugging>General menu.
Set 'Configuration Manager' => Debug
before i reinstalled visual studio i had an option to choose a blank html/js only template. There is still an option for a blank JS project but it's different and it seems like it's supposed for windows 8 store apps.
I found a picture from a typescript template. I had the same option for javascript:
(source: msdn.com)
Now it's gone and I'd like to have it back. Maybe someone can help me out?
Thanks in advance
You have to restore the default project templates so as to fix your problem.
In the command prompt, navigate to the location of devenv.exe. This file is located in <Visual Studio Installation Path>\Common7\IDE.
Note:
If you are running Windows Vista or Windows 7, you must open the command prompt as an administrator
Type "devenv /installvstemplates" and press Enter.
Note:
If you are using an Express Edition of Visual Studio, type "<ExpressName>Express /installvstemplates" where <ExpressName> is either VB or VCS for Visual Basic and Visual C#, respectively.
By default, templates installed together with the product are located in:
\VisualStudioInstallationDirectory\Common7\IDE\ItemTemplates\Language\Locale\
\VisualStudioInstallationDirectory\Common7\IDE\ProjectTemplates\Language\Locale\
For example, the following directory contains the Visual Studio project templates for English:
C:\VisualStudioInstallationDirectory\Common7\IDE\ItemTemplates\VisualBasic\1033\
Try to empty them first and then reinstall .If this procedure does not restore the default templates, reinstall Visual Studio.
I have Visual Studio 2012 installed on my laptop and desktop. On my desktop PC, the JavaScript intellisense is not working. For any method it pulls up (even standard JavaScript calls) I receive the message, "Intellisense was unable to determine an accurate completion list for this expression".
I've tried all of the suggestions from the other posts and tried everything I could find on Google. Nothing has worked. It isn't about not having JQuery Intellisense. I don't get even basic JavaScript Intellisense.
Edit:
The objects in the above images are simple strings, yet I don't get any help from the Intellisense.
I had the same problem: in Visual Studio 2010 I was used to add a reference in my javascript files, at the top, like this:
/// <reference path="/scripts/jquery-1.7.1-vsdoc.js" />
With the new Visual Studio 2012 this was not working anymore, I looked around and found the solution to put the reference in /scripts/_references.js I did so, not working.
What I was doing wrong was that I was referencing the vsdoc.js file, or at the moment of writing, nuget downloaded jquery 1.9.1 package, reference to jquery-1.9.1.intellisense.js which is WRONG.
The correct reference (if using the /scripts/_references.js file) is:
/// <reference path="/scripts/jquery-1.9.1.js" />
(NOT the .intellisense.js or the -vsdoc.js file).
For the global solution to work on all your projects: copy all the jquery files (main, minified, map, and intellisense one, to be sure) in C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References (adapt the path if you installed Visual Studio 2012 somewhere else) and in Visual Studio, under Tools > Options > Text Editor > Javascript > Intellisense > References > Add a reference to jquery-1.9.1.js (again, NOT the vsdoc or intellisense file, but the main one) as explained in the solution by denas (but it was not clearly said not to point the vsdoc/intellisense file).
Hope this helps.
Many things can cause problems like this, but I usually follow these steps to troubleshoot it.
close visual studio and restart
reboot windows and start visual studio again
have another developer load your project and test it
create a bare bone project and test with all stock javascript references
reset IDE
run VS in safe mode and test your project
uninstall and reinstall vs
I usually resolve most of the VS problems at step 3 or 4, and sometimes 5.
If you've installed VS on anything other than the C Drive this will happen.
In Visual Studio, under Tools > Options > Text Editor > Javascript > Intellisense > References
Add references to the same .js files that exist in the list but pointing to the new path where you have VS installed
eg - G:\Program Files\Microsoft Visual Studio 11.0\JavaScript\References.libhelp.js
There are 5 of them
After this go to Edit> Intellisense > Refresh external references
I fixed the same problem by right-clicking the file in Solution Explorer and choosing Open With and then choosing Web Form Editor if you're editing a Web form or Source Code (Text) Editor if you're editing a JavaScript file.
In visual studio 2012,
Using this solution https://github.com/jmbledsoe/angularjs-visualstudio-intellisense.
Make sure put ng, ngCookies modules into required fields. For example:
var module = angular.module("demo", ['ng','ngCookies']);
An excellent article by Mads Kristensen helped me fix the JavaScript Intellisense issue.
Triple-slash references look like this and can be added to
the top of any .js file or in /scripts/_references.js file
/// <reference path="../app/respond.js" />
REF: http://madskristensen.net/post/the-story-behind-_referencesjs