VS2015 preview + TypeScript 1.3 = error - visual-studio

I have just installed VS2015 Preview. I created a MVC project. I added a new typescript file. I have tried to compile and I got:
The "TypeScript.Tasks.VsTsc" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\TypeScript.tasks.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\TypeScript.tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. WebApplication1
I have tried to search for TypeScript.tasks.dll and I only found:
c:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\TypeScript.Tasks.dll
and
c:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\TypeScript\TypeScript.Tasks.dll
How to make it work?

It helped to install TypeScript 1.3 for Visual Studio 2013 after the installation of the Visual Studio 2015. Strange...

There indeed seems something wrong with the installer for the TypeScript 1.3 powertool, I found that using the repair option in Add/Remove Programs fixed the install in most cases.

Related

Libjna build - LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'

I'm re-posting an issue from github (https://github.com/libffi/libffi/issues/538) I had since last week.
I'm currently having issue getting some JNA libraries built as jar deployables using Ant build script (FYI: https://github.com/thepaul/libjna-java). in order to use the APIs from this library for my other project. (The sole purpose of me going through the hassle building it is to be able to use its API. Due to lack of documentation and absence of existing build artifact provided, I had to do it myself. Importing the whole libjna repo as a project into my other project maybe another approach but I don't think it's appropriate. That said, if there're any better ways to use the libraries in libjna, do let me know!)
So here's what I did trying to build it into deployable jar file:
I already have the source project downloaded.
Tried to compile using Ant (which I downloaded the latest version) on cygwin. Failed because it requires libffi.
So I downloaded libffi source from here (https://github.com/libffi/libffi).
Tried to compile again using Ant. Failed because it couldn't find "/c/Program Files (x86)/Microsoft Visual Studio 9.0/vc/bin/cl" as mentioned in the config.log
So I inspected cc.sh and found that it refers to an older version of Microsoft Visual Studio. I have an existing installation of Visual Studio Express. So I changed the path to "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x64" in cc.sh file.
Tried to complile again using Ant. Seemed the fix worked but failed with different error because it couldn't find "mspdbcore.dll". I found this file in "..\x86" so I copy the file across to ..\x64
Tried to compile again using Ant. Failed with similar error but different file because it couldn't find "mspdb140.dll". I found this file in "..\x86" so I copied over
Tried to compile again. Failed with different error because now it says
"LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'"
, although I could confirm this file is definitely in "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\lib\x64"
To tackle this error I tried (in vain):
adding microsoft visual studio paths to PATH
C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x64
C:\Program Files (x86)\Microsoft Visual
Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\lib\x64
C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\Common7\IDE
Downloaded MS Visual Studio 2019 both Community and Professional (couldn't find those dlls for some reason)
Downloaded both mspdb140.dll and mspdbcore.dll separately, config.log says it can't find these files
Note I also did some research online, however:
I don't use visual studio IDE as I"m only trying to build it with Ant, so this post didn't really help much (LINK: fatal error LNK 1104: cannot open file 'LIBCMT.lib')
I don't really understand the answer to this post either (https://social.msdn.microsoft.com/Forums/en-US/cbedc1ba-c50b-499e-aa2e-12b0ce6a40ba/lnk1104-cannot-open-file-libcmtlib?forum=vclanguage)
So this is where I'm stuck.
See latest config log attached.
config.log
Also Ant build log attached.
ant_compile_error.txt
Anyone can help would be much appreciated!
Cheers
Dale

PVS Studio not working with MSVS not installed in default location

Due to disk size constraints, I installed MSVS 2017 to D:\Program Files\Visual Studio.
I then installed PVS-Studio v6.14. When I tried to run it, I get the following error messages:
Error was encountered while opening project 'MIDI2LR.vcxproj'. 0
Exception message: 0
Could not find a part of the path 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC'. 0
It also appears that PVS-Studio did install its extensions into the D:\Program Files\Visual Studio\Common7\IDE\Extensions\3ci0fu2p.p0x directory, so it appears that the installer found the executable.
How do I point PVS-Studio to the correct directories?
If I have understood correctly, we are talking about /Builds/VisualStudio2017/MIDI2LR.vcxproj from your repository (develop branch). If you're talking about another project, please specify it. The information is based on the analysis of the project I mentioned before.
Does this project compile on your machine? If a project does not compile, PVS-Studio does not guarantee the analysis. Otherwise, the analysis should be performed correctly. I also note that for the compilation you have to have the components Visual C++ Build Tools 2015 installed (in this context we use the contents of the directory C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC).
In this case, such behavior occurs because of your project's file structure – the PlatformToolset property is set with a value v140 before the import of Microsoft.Cpp.Default.props, thus this import is performed based on this toolset. This causes MSBuild to use the compiler from Visual C++ 2015, and not from Visual C++ 2017.
To compile using the compiler from VS2017 (V141 toolset), you need to modify the project file (see example of a console application project file that is created in Visual Studio 2017). Then the compilation should be done with a correct compiler and the analysis with PVS-Studio performed correctly.

No TypeScript compiler was found at C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe

I installed Visual Studio 2015 and TypeScript 1.8.6 for Visual Studio 2015. After creating a new TypeScript project and building, I get this build error:
No compiler was found at C:\Program Files (x86)\Microsoft
SDKs\TypeScript\1.8\tsc.exe
Indeed, tsc.exe is missing in the file system.
Things I've tried:
Uninstall and re-install TypeScript Tools for Visual Studio 2015 1.8.6.0
Uninstall and re-install TypeScript Tools for Visual Studio 2013 1.8.5.0
Repair TypeScript Tools for Visual Studio 2015 1.8.6.0
I HAVE tried turning it off and on again :-)
Any clue on how to solve this? Which component installs the TypeScript SDK?
MSBuild is looking in the wrong place for tsc.exe
It should be looking in 'C:\Program Files (x86)\Microsoft SDKs\TypeScript\ tsc version \tsc.exe'
e.g. C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe
The one thing the TypeScript SDK installer wont do, is upgrade your existing projects. So all that reinstalling wont change anything. However, if you want MSBuild to use the newer compiler, you can upgrade your project yourself.
I don't think there is any way to do this through the UI, but it's easy enough to edit the Project file.
It needs to contain this in the first PropertyGroup
<TypeScriptToolsVersion>1.7</TypeScriptToolsVersion>
If you want the build to use v1.8.6, you need to set
<TypeScriptToolsVersion>1.8</TypeScriptToolsVersion>
In your case, I'm betting it's not there at all. So you should just add it.
I'm not experienced with using the TypeScript tools for Microsoft.. what you could do is use Gulp or Grunt tasks to compile TypeScript, this will even allow you to compile the TypeScript files everytime your save your .ts files.
You will need NPM (Node Package Manager) to install Gulp or Grunt and then install the package for compiling TypeScript.
You can find some information about the Grunt TypeScript package here: https://www.npmjs.com/package/grunt-typescript
Or for information about the Gulp TypeScript package, check this: https://www.npmjs.com/package/gulp-typescript
I've read through the comments on this issue on the TypeScript Github repo. Although this is a different issue, I did find a clue: repairing Visual Studio 2015 (through the Control Panel) installed tsc.exe in the correct folder.

Visual Studio Team Services build process cannot find CSharp targets file

I'm trying to set up a build process in Visual Studio Team Services, and I've done so by following the steps for UWP projects using an agent on my box, but I keep getting the following build errors:
C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\Microsoft.Windows.UI.Xaml.CSharp.targets(7,3): Error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\10.0.10240.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
I checked out the path the build is complaining about and the problem is in the 10.0.10240.0 in the path:
C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\10.0.10240.0\Microsoft.Windows.UI.Xaml.CSharp.targets
The target file is located in
C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\Microsoft.Windows.UI.Xaml.CSharp.targets
Here is how the declaration in the project file looks like (I don't think it is erroneous and I don't see where this weird 10.0.10240.0 version comes from in the path):
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
Any suggestions on what could be wrong and how can I fix that?
The Universal Windows Platform was introduced in Windows 10. Visual Studio has support for UWP apps as of Visual Studio 2015. You need to use VS2015 to create a UWP project, and install VS2015 on your build agent machine.

MSBuild failing to find assembly following upgrade to VS2015

We have a build script which uses MSBuild to build our solution. It has worked fine for VS2013, but it has broken since we installed VS2015 and upgraded. Initially, it failed with this error:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for v140
(Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools. Alternatively, yo
u may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgra
de Solution...". [C:\Users\user\Documents\GitHub[snipped]Api.vcxproj]
So it was failing to build a C++ project since is seemed to default to using version 12 of MSBuild, even though it was a VS2015 project. So I added:
/tv:14.0
To the invocation of MSBuild to force it to use the right tools version. Now it fails with this:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(219,5): error MSB4175: The ta
sk factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.v12
.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.v12.0.dll' or one of
its dependencies. The system cannot find the file specified. [C:\Users\user\Documents\GitHub[snip].Api.vcxproj]
Now it's looking for a v12 assembly in the v14 folder. How do I fix this? I can't see any obvious place to make this change.
Note: The C++ project itself might be a red herring, the solution is mostly C# and this might just be the place where it loads in the tasks.

Resources