Typescript will not properly compile in VS2012 - visual-studio

For no clear reason, Typescript has suddenly stopped reliably compiling into JS code.
Using VS2012, Typescript for VS ver 0.8.3.1 and Web Essentials ver 2.6 (set to "Compile on Save").
I can create a new Typescript file and make simple changes to it (such as export a simnple var or function). I can save TS file and see the JS translation.
HOWEVER, once I add one or more TS definition files (I'm using AMD) and then edit the TS file, NO FURTHER CHANGES APPEAR IN THE CORRESPONDING JS FILE. Edits to the TS file will no longer update the JS. Typescript no longer checks for errors either.
Only when I close and reopen VS2012 will the proper JS file finally appear.
I've uninstalled/reinstalled Typescript, Web Essentials and VS2012 to no avail.
Does anyone have any suggestions on how I can fix this problem? I'm at a loss.
EDIT
This is an entirely reproducible condition. Today, I formatted my drive and re-installed VS2012 anew. USING 64-bit version of Windows 7. Created a new MVC4 project. Created a new TS file. Added a couple of definition files. Attempted to edit the default getDist() function. Saved. No update to the JS file. Removed the definition files. Saved. JS file is properly updated as expected.
IT'S IMPOSSIBLE TO IMAGINE THAT I'M THE ONLY ONE EXPERIENCING THIS PROBLEM!!
Please help!
RE-EDIT
Problem solved. See below.

it happened to me,
i solved this issue by setting the build action of the ts file to TypeScriptCompile

Please see : Preview pane for TypeScript missing and/or not updating in VS2012/13
Also check that there are no compile errors in the TS files - a language update can create an error without you noticing, and the new version of WE simply does not update the preview pane like it used to.

Related

Ink.Runtime not found

I've been trying to use Ink for my Unity Project.
https://assetstore.unity.com/packages/tools/integration/ink-unity-integration-60055
After installation through the Package Manager, everything on Unity seems to work fine (Ink files can be created, they get compiled to JSON, the Ink Player tab works, etc etc) - with one exception:
I can't get VisualStudio to find the Ink namespace. I've tried restarting it and Unity. It worked fine for other packages like the new Unity Input system and TextMeshPro.
What can I do to fix this?
Edit: Regenerating project files with all checkboxes checked doesn't seem to work either.
Edit 2: If I open a C# script from Ink itself (Asset/Ink/), then VS seems to recognize Ink.Runtime. Its only in my own scripts (which are also in Asset/) that don't have the namespace:
In this case, I managed to fix it by deleting the ".vs" folder inside the project folder.

Visual Studio 2017 cannot build blank app after disabling/reenabling xaml designer?

I am trying rebuild a C++/winrt app by beginning with the BlankApp1 that is created by VS2017 - at first the blankapp built and ran just fine, but then I tried disabling xaml designer using the disable switch in tools/options/xaml (I prefer not to use the designer). However, the original sample xaml files remained, so the sample interface remained. I tried deleting the xaml files, after which nothing would build. Finally I trashed the whole blankapp directory, turned xaml designer back on in VS, restarted VS, and now have tried twice to create and run new BlankApps without changing anything in them. I get build errors: "Cannot open include file 'XamlMetaDataProvider.g.h' (compiling source file GeneratedFiles\XamlTypeInfo.Impl.g.cpp)" Does anyone know what to change in VS to make it functional again? And if I want to disable designer, is it enough to turn it off in options, or do certain files also need changing?
I think I know how to make it build and run, though I haven't yet succeeded in programmatically adding xaml elements as I had done with a previous app. Here's what makes the blankapp compile and run with the xamldesigner disabled: (1) Use the switch in Tools/Options/Xaml to turn off the designer, then restart Visual Studio. (2) Find the mainpage.idl and insert this declaration:
runtimeclass XamlMetaDataProvider : Windows.UI.Xaml.Markup.IXamlMetadataProvider
{
XamlMetaDataProvider();
};
That seems to be the missing step required if the designer gets turned off. I hope someone will correct me if I'm mistaken, but this appears to do the trick.
[Update] In Visual Studio 15.9.0 Preview 3, now with support for xaml designer in C++/winrt apps, I cannot find a way to use the complex and dynamic xaml interface I had created programmatically in the previous VS. I may have to post a new and separate question about this: is it still possible to programmatically add xaml elements?

XNA - Reconnecting Content Project

I'm working with XNA 4 in VS2010. Recently a crash corrupted a .contentproj file of mine. So I deleted the content project inside VS, created a new one and repopulated it with the contents of the old one. However the new content project did not properly hook up to the rest of the program, whenever I build the program its contents aren't translated to .xnb-s and placed inside the content folder of the game as when I built the program with the original content project.
I'm sure I'm missing a step in reconnecting the new content project, I just can't seem to be able to find out what that step is. Any ideas?
Thank you.
Take a look at the properties of the imported files in Visual Studio and check they are correct. Check the Build Action specifically. It should be set to Compile.
I found a way to make it work. More a workaround than a solution, I created a new VS solution, imported everything other than the content project from the old one and used the content project that came with the new solution.

Typescript 0.8.3.1 Compile-On-Save degraded and stopped working today

Visual Studio 2012, Typescript 0.8.3.1 Yesterday, I started having problem where, when I saved 1 .ts file, it would show me errors (about 6 in 3 files because they relied on the change I had just done), when I saved one of the other files that I went to fix the error it would none of the errors (even if I didn't fix).
When I rebooted, for the first 3 or 4 minutes, it showed no errors, but then 'suddenly' doing a save by adding and removing a space, the errors showed up, but then when I made a 'real' change, the js file did not change.
I can make any change I want and the js only changes if I exit VS and come back in, and when it reloads (I've tried this a few times) the js file is sometimes several changes out of date from the ts file, sometimes is based on the newest ts file.
I uninstalled the ts plugin and web essentials this morning and reinstalled (still 0.8.3.1).
No differences that I can see to the symptoms.
I have verified that both Visual Studio settings in Tools > Options > Text Editor > TypeScript > Project > Compile on Save settings are Unchecked and that the Webessentials one IS checked to compile on save.
There are no 'new' files and the only changes I've made in the past few days other than those noted above are to edit my existing ts files. Yesterday it appeared to be working fine until these anomalies started to occur.
The issue you are describing sounds like either...
A genuine bug in your code that isn't getting shown immediately
A problem with the state of the incremental editor
If it is the latter, there are improvements coming in newer versions. If you need help checking for code problems you'll need to share the code or a cut down example that demos the problem.

In debug mode, the dynamically generated script file doesn't reflect saved changes

In VS 2010, I have an asp.net web application project. I made a change to a java-script file and saved it. I then run the application in debug mode and looked at the corresponding dynamically generated java script file. The dynamically generated file still represents the code before i made the recent changes. I tried restarting VS and my computer to no avail... This issue just started happening for no apparent reason.
Thanks,
Right click on solution, and click clean.

Resources