Cordova build fails since upgrade to 2017. Error from output as below:
Building project: C:\code\presales\PresalesApp\PresalesApp\platforms\windows\CordovaApp.Windows10.jsproj
Configuration : debug
Platform : x64
C:\code\presales\PresalesApp\PresalesApp\platforms\windows\CordovaApp.Windows10.jsproj(61,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\JavaScript\Microsoft.VisualStudio.WJProject.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
1>MSBUILD : cordova-build error : Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1
1>Done building project "PresalesApp.jsproj" -- FAILED.
Have had a look at modules installed and all Windows 10 UWP items seem to be installed.
Anyone else upgraded from 15-17 and had a similar issue?
Verbose Build Log:
1> Task "CreateBuildInfoMetadata" skipped, due to false condition; ( '$(Platform)' == 'android' AND '$(TelemetryEnabled)' == 'True' ) was evaluated as ( 'Windows-x86' == 'android' AND 'True' == 'True' ).
1> Using "CreateBuildInfoMetadata" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\ApacheCordovaTools\vs-mda-targets\Microsoft.VisualStudio.MultiDeviceHybridApps.MdaBuildTasks.dll".
1> Task "CreateBuildInfoMetadata"
1> Done executing task "CreateBuildInfoMetadata".
1> Using "VsTac" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\ApacheCordovaTools\vs-mda-targets\Microsoft.VisualStudio.MultiDeviceHybridApps.MdaBuildTasks.dll".
1> Task "VsTac"
You have been opted out of telemetry. To change this, run: cordova telemetry on.
[VSTAC_VERBOSE]No scripts found for hook "before_build".
[VSTAC_VERBOSE]No scripts found for hook "before_prepare".
[VSTAC_VERBOSE]Checking config.xml for saved platforms that haven't been added to the project
[VSTAC_VERBOSE]Checking for any plugins added to the project that have not been installed in windows platform
[VSTAC_VERBOSE]No differences found between plugins added to project and installed in windows platform. Continuing...
[VSTAC_VERBOSE]Generating config.xml from defaults for platform "windows"
[VSTAC_VERBOSE]Found "merges" for windows platform. Copying over existing "www" files.
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\Square150x150Logo.scale-100.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\Square150x150Logo.scale-100.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\Square150x150Logo.scale-240.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\Square150x150Logo.scale-240.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\Square30x30Logo.scale-100.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\Square30x30Logo.scale-100.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\Square310x310Logo.scale-100.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\Square310x310Logo.scale-100.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\Square44x44Logo.scale-100.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\Square44x44Logo.scale-100.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\Square44x44Logo.scale-240.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\Square44x44Logo.scale-240.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\Square70x70Logo.scale-100.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\Square70x70Logo.scale-100.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\Square71x71Logo.scale-100.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\Square71x71Logo.scale-100.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\Square71x71Logo.scale-240.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\Square71x71Logo.scale-240.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\StoreLogo.scale-100.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\StoreLogo.scale-100.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\StoreLogo.scale-240.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\StoreLogo.scale-240.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\Wide310x150Logo.scale-100.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\Wide310x150Logo.scale-100.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\icons\windows\Wide310x150Logo.scale-240.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\Wide310x150Logo.scale-240.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\screens\windows\SplashScreen.scale-100.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\SplashScreen.scale-100.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\screens\windows\SplashScreen.scale-240.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\SplashScreenPhone.scale-240.png
[VSTAC_VERBOSE]Copying image from C:\code\presales\PresalesApp\PresalesApp\res\screens\windows\SplashScreenPhone.scale-240.png to C:\code\presales\PresalesApp\PresalesApp\platforms\windows\images\SplashScreenPhone.scale-240.png
[VSTAC_VERBOSE]Updated project successfully
[VSTAC_VERBOSE]No scripts found for hook "pre_package".
[VSTAC_VERBOSE]Executing script found in plugin cordova-plugin-ms-adal for hook "after_prepare": plugins\cordova-plugin-ms-adal\scripts\prePackage-windows.js
[VSTAC_VERBOSE]Resolving module name for shelljs => shelljs
[VSTAC_VERBOSE]Resolving module name for path => path
[VSTAC_VERBOSE]Resolving module name for fs => fs
[VSTAC_VERBOSE]Checking config.xml for saved plugins that haven't been added to the project
------ Building platform: windows
------ Build configuration options: --debug -- --win --archs x86
You have been opted out of telemetry. To change this, run: cordova telemetry on.
[VSTAC_VERBOSE]No scripts found for hook "before_compile".
[VSTAC_VERBOSE]Reading build config file: C:\code\presales\PresalesApp\PresalesApp\build.json
[VSTAC_VERBOSE]Searching for available MSBuild versions...
[VSTAC_VERBOSE]Found MSBuild v12.0 at C:\Program Files (x86)\MSBuild\12.0\bin\
[VSTAC_VERBOSE]Found MSBuild v14.0 at C:\Program Files (x86)\MSBuild\14.0\bin\
[VSTAC_VERBOSE]Found MSBuild v4.0 at C:\Windows\Microsoft.NET\Framework\v4.0.30319\
Building project: C:\code\presales\PresalesApp\PresalesApp\platforms\windows\CordovaApp.Windows10.jsproj
Configuration : debug
Platform : x86
C:\code\presales\PresalesApp\PresalesApp\platforms\windows\CordovaApp.Windows10.jsproj(61,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\JavaScript\Microsoft.VisualStudio.WJProject.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
1> MSBUILD : cordova-build error : Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1
1> Done executing task "VsTac" -- FAILED.
1>Done building target "BuildMDA" in project "PresalesApp.jsproj" -- FAILED.
1>
1>Done building project "PresalesApp.jsproj" -- FAILED.
1>
1>Build FAILED.
1>
In my BuildTools folder (C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0) there isn't a Javascript Folder, only a TypeScript folder, but I have selected all options when installing the BuildTools?
After I removed the platform (VS 2015 generated directory) and rebuild, the CLI will get the correct build files for VS2017, and successfully build the project.
VS can do a better job by: Migrate document make it clear, or clear the build didn't clean up the corresponding platform directory.
Related
How can I publish the UWP package via command line?
I have a WPF application that is packaged with a Windows Application Package Project that ends up being published to the Microsoft Store.
In order to be accepted in the Store, the WPF project needs to be compiled with a preprocessor directive (that I named as "UWP"), deactivating stuff that are not allowed for Store apps.
I'm in the process of migrating the WPF app from .NET Framework 4.8 to .NET 5 and along with that I'm trying to streamline my publishing process via command line.
Is there any way to configure or update the package to support ARM64?
The app will be published outside the Store as x86, x64 and ARM64 and I intend to do the same for the Store version.
When checking the WAPP, I noticed that ARM64 is not available on the list. As you can see in the screenshot, I was able to create a ARM64 build profile, but the architecture is not available on the table.
What have I tried? (Command line issue)
I tried running this command:
MSBuild.exe C:\Project-UWP\Project.UWP\Project.UWP.wapproj /p:DefineConstants=UWP /p:Configuration=Release;AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM64" /p:OutDir="..\Publish\UWP"
But got these errors:
Microsoft (R) Build Engine version 16.11.0+0538acc04 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 29/09/2021 22:09:19.
Project "C:\Project-UWP\Project.UWP\Project.UWP.wapproj" on node 1 (default targets).
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1718,5): warning NU1702: ProjectReference 'C:\Project\Project.csproj' was resolved using '.NETCoreApp,Version=v6.0' instead of the project target framework '.NETFramework,Version=v4.5.1'. This project may not be fully compatible with your project. [C:\Project-UWP\Project.UWP\Project.UWP.wapproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1718,5): warning NU1702: ProjectReference 'C:\Project\Project.csproj' was resolved using '.NETCoreApp,Version=v6.0' instead of the project target framework '.NETFramework,Version=v4.5.1'. This project may not be fully compatible with your project. [C:\Project-UWP\Project.UWP\Project.UWP.wapproj]
_ResolveVCLibDependencies:
Searching for SDKs targeting "UAP, 10.0.20348.0".
Project "C:\Project-UWP\Project.UWP\Project.UWP.wapproj" (1) is building "C:\Project\Project.csproj" (2:9) on node 1 (publish target(s)).
C:\Program Files\dotnet\sdk\5.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1047: Assets file 'C:\Project\Project\obj\project.assets.json' doesn't have a target for 'net5.0-windows/win-x86'. Ensure that restore has run and that you have included 'net5.0-windows' in the TargetFrameworks for your project. You may also need to include 'win-x86' in your project's RuntimeIdentifiers. [C:\Project\Project.csproj]
Done Building Project "C:\Project\Project.csproj" (publish target(s)) -- FAILED.
Done Building Project "C:\Project-UWP\Project.UWP\Project.UWP.wapproj" (default targets) -- FAILED.
Build FAILED.
"C:\Project-UWP\Project.UWP\Project.UWP.wapproj" (default target) (1) ->
(_GetProjectReferenceTargetFrameworkProperties target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1718,5): warning NU1702: ProjectReference 'C:\Project\Project.csproj' was resolved using '.NETCoreApp,Version=v6.0' instead of the project target framework '.NETFramework,Version=v4.5.1'. This project may not be fully compatible with your project. [C:\Project-UWP\Project.UWP\Project.UWP.wapproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1718,5): warning NU1702: ProjectReference 'C:\Project\Project.csproj' was resolved using '.NETCoreApp,Version=v6.0' instead of the project target framework '.NETFramework,Version=v4.5.1'. This project may not be fully compatible with your project. [C:\Project-UWP\Project.UWP\Project.UWP.wapproj]
"C:\Project-UWP\Project.UWP\Project.UWP.wapproj" (default target) (1) ->
"C:\Project\Project.csproj" (publish target) (2:9) ->
(ResolvePackageAssets target) ->
C:\Program Files\dotnet\sdk\5.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1047: Assets file 'C:\Project\obj\project.assets.json' doesn't have a target for 'net5.0-windows/win-x86'. Ensure that restore has run and that you have included 'net5.0-windows' in the TargetFrameworks for your project. You may also need to include 'win-x86' in your project's RuntimeIdentifiers. [C:\Project\Project.csproj]
2 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.31
Notice that there are warnings related to framework references:
ProjectReference C:\Project\Project.csproj was resolved using .NETCoreApp,Version=v6.0 instead of the project target framework .NETFramework,Version=v4.5.1.
This project may not be fully compatible with your project. Microsoft.Common.CurrentVersion.targets 1719
The WPF project was set to use .NET 5, so I don't see why there's any reference to .NETCoreApp 6 or .NET Framework 4.5.1.
What have I tried? (Missing ARM64 issue)
I created a WAPP from scratch and saw that the option for ARM64 appeared in the architecture table.
But when publishing manually via the context menu, I'll get this error:
The specified RuntimeIdentifier 'win-ARM64' is not recognized.
I'm using VS 2019 and Android SDK API 30.
The deployment of the android app is successful message is shown in the output window but the app is not seen on the emulator.
The output log is posted below:
Output Log:
Build started...
1>------ Build started: Project: Jeevitham, Configuration: Debug Any CPU ------
...
4>Starting deployment to pixel_2_r_11_0_-_api_30 ...
4>Starting emulator pixel_2_r_11_0_-_api_30 ...
4>C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -no-boot-anim -verbose -avd pixel_2_r_11_0_-_api_30 -prop monodroid.avdname=pixel_2_r_11_0_-_api_30
4>Emulator pixel_2_r_11_0_-_api_30 is running.
4>Deploying to pixel_2_r_11_0_-_api_30 ...
Build started.
Project "Jeevitham.Android.csproj" (Install target(s)):
Found Java SDK version 1.8.0.
Found Java SDK version 1.8.0.
PackageName: com.companyname.jeevitham
Dex Fast Deployment Enabled: False
MonoAndroid Tools: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\
Android Platform API level: 30
TargetFrameworkVersion: v11.0
Android NDK:
Android SDK: C:\Program Files (x86)\Android\android-sdk\
Android SDK Build Tools: C:\Program Files (x86)\Android\android-sdk\build-tools\30.0.2\
Java SDK: C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25\
Application Java class: android.app.Application
Project "Jeevitham.csproj" (GetTargetFrameworks target(s)):
Done building project "Jeevitham.csproj".
Project "Jeevitham.csproj" (GetTargetPath target(s)):
Done building project "Jeevitham.csproj".
Project "Jeevitham.csproj" (GetNativeManifest target(s)):
Done building project "Jeevitham.csproj".
Skipping target "_ResolveLibraryProjectImports" because all output files are up-to-date with respect to the input files.
...
Skipping target "_CompileToDalvik" because all output files are up-to-date with respect to the input files.
Copying file from "z:\mobile\VSPodcast\Jeevitham new\Jeevitham\Jeevitham.Android\obj\Debug\110\android\bin\com.companyname.jeevitham.apk" to "z:\mobile\VSPodcast\Jeevitham new\Jeevitham\Jeevitham.Android\bin\Debug\com.companyname.jeevitham.apk".
Continued output log in the output Window:
Creating "obj\Debug\110\android_debug_keystore.flag" because "AlwaysCreate" was specified.
C:\Program Files (x86)\Android\android-sdk\build-tools\30.0.2\zipalign.exe -p 4 "z:\mobile\VSPodcast\Jeevitham new\Jeevitham\Jeevitham.Android\obj\Debug\110\android\bin\com.companyname.jeevitham.apk" "bin\Debug\\com.companyname.jeevitham-Signed.apk"
C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25\bin\java.exe -jar "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\apksigner.jar" sign --ks "C:\Users\John Mangam\AppData\Local\Xamarin\Mono for Android\debug.keystore" --ks-pass pass:android --ks-key-alias androiddebugkey --key-pass pass:android --min-sdk-version 21 --max-sdk-version 30 "z:\mobile\VSPodcast\Jeevitham new\Jeevitham\Jeevitham.Android\bin\Debug\com.companyname.jeevitham-Signed.apk"
Signed android package 'bin\Debug\com.companyname.jeevitham-Signed.apk'
Using cached value from RegisterTaskObject
Found device: emulator-5554
Creating "obj\Debug\110\upload.flag" because "AlwaysCreate" was specified.
Creating directory "obj\.cache\".
Done building project "Jeevitham.Android.csproj".
Build succeeded.
4>Deployment was successful to pixel_2_r_11_0_-_api_30.
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
I'd like to use a script to build translations (convert from .ts to .qm, using Qt's lrelease.exe) before compiling the resource file (QRC) where they are included. In this way I know they are always updated, not to mention to avoid including binary files in the repository.
I use Visual Studio and have installed the Qt Visual Studio Tools. Normally, I'd do this through a pre-build step in the project, but it is not being executed and the compilation of the QRC file always fails.
1>------ Build started: Project: MyApp, Configuration: Release Win32 ------
1>Rcc'ing MyApp.qrc...
1> RCC: Error in 'C:\src\MyApp\MyApp\MyApp.qrc': Cannot find file 'translations/myapp_en.qm'
1>MyApp.qrc : error 1: rcc (c:\Qt\qt_5_12_3\v141\Win32\bin\rcc.exe)
1>Done building project "MyApp.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 12 up-to-date, 1 skipped ==========
The script works correctly and it is called successfully either if placed as a post-build event or from command line.
#echo off
pushd "%1"
for %%F in (*.ts) do (
c:\Qt\qt_5_12_3\v141\Win32\bin\lrelease -compress %%F -qm %%~nF.qm
)
popd
exit /b 0
What I'm I doing wrong?
It happened that I was using the new Qt/MSBuild mode of Qt VS Tools. Internally it generates several hidden targets in the MSBuild workflow, which are executed before the pre-build events.
The solution was to use a custom build step instead, with some specific settings:
Execute before the QtRcc target (the one that actually compiles the resource file)
The Qt VS Tools parses QRC files to check if the resources have been modified, so it can skip compiling them. It is necessary to add the .qm translation files as output of the custom build step.
Similarly, to guarantee translations are always compiled, set dependencies of the custom build step to the .ts source files.
I am building my project on a Visual Studio online HOsted server which says it it is running an older version:
PreComputeCompileTypeScriptWithTSConfig:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe has TypeScript 2.0.6 installed.
When I attempt to build, I get build errors which I believe are being caused as --project "d:_work\9\s\Main\SRC\Portal\tsconfig.json"
CompileTypeScriptWithTSConfig:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe --project "d:_work\9\s\Main\SRC\Portal\tsconfig.json"
##[error]VSTSC(0,0): Error TS5023: Build: Unknown compiler option 'baseUrl'.
VSTSC : error TS5023: Build: Unknown compiler option 'baseUrl'. [d:_work\9\s\Main\SRC\MyProject.csproj]
##[error]VSTSC(0,0): Error TS5023: Build: Unknown compiler option 'paths'.
VSTSC : error TS5023: Build: Unknown compiler option 'paths'. [d:_work\9\s\Main\SRC\MyProject.csproj]
##[error]VSTSC(0,0): Error TS5023: Build: Unknown compiler option 'typeRoots'.
VSTSC : error TS5023: Build: Unknown compiler option 'typeRoots'. [d:_work\9\s\Main\SRC\MyProject.csproj]
Done Building Project "d:_work\9\s\Main\SRC\MyProject.csproj" (default targets) -- FAILED.
Done Building Project "d:_work\9\s\Main\Solutions\MyProject.sln" (default targets) -- FAILED.
I have a specified
<TypeScriptToolsVersion>2.0</TypeScriptToolsVersion>
In my project file, but it doesn't seem to be recognized. What am I missing to force the newwer TS version to run? Is this being caused by something else possibly?
UPDATE:
It appears I can downgrade to 1.7 and it will recognize (but break obviously), but it will not use 2.0 - which would indicate that it is not installed on the Hosted machine. After setting the build command manually to
I then get the error
[error]C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(165,5):
Error : Your project file uses a different version of the TypeScript
compiler and tools than is currently installed on this machine. No
compiler was found at C:\Program Files (x86)\Microsoft
SDKs\TypeScript\2.0\tsc.exe. You may be able to fix this problem by
changing the element in your project file.
But according to this: https://www.visualstudio.com/en-us/docs/build/admin/agents/hosted-pool#software - it should be installed (using Visual Studio 15), correct?
The test result is the same to you, it still uses 1.8.
Refer to these steps to deal with this issue:
Add/Install Microsoft.TypeScript.MSBuild package to your project
Edit your project file (.csproj)
a.) Configure MSBuild to use the NuGet package's props file.
<Import Project="..\packages\Microsoft.TypeScript.MSBuild.2.0.6\build\Microsoft.TypeScript.MSBuild.props" Condition="Exists('..\packages\Microsoft.TypeScript.MSBuild.2.0.6\build\Microsoft.TypeScript.MSBuild.props')" />
<!--<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />-->
b.) Configure MSBuild to use the NuGet package's targets file.
<Import Project="..\packages\Microsoft.TypeScript.MSBuild.2.0.6\build\Microsoft.TypeScript.MSBuild.targets" Condition="Exists('..\packages\Microsoft.TypeScript.MSBuild.2.0.6\build\Microsoft.TypeScript.MSBuild.targets')" />
<!--<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />-->
If it is .Net Core project, add this code to section of .xproj file
<TypeScriptToolsVersion>2.0.6</TypeScriptToolsVersion>
<TscToolPath>C:\Users\[user account]\.nuget\packages\Microsoft.TypeScript.MSBuild\2.0.6\tools\tsc</TscToolPath>
Building a basic C++ project with Visual Studio 2012. When I make changes to source files:
the corresponding object files are compiled
the .tlog files for the compiler are updated
the PDB file is updated
the .tlog files for the linker however are not changed
the linker claims All outputs are up-to-date. and does not build a new executable.
The only way to get the executable to be built is deleting it. It seems something with the tracking system is wrong and I was wondering if anyone can shed some light on this issue.
Here is the msbuild output after I change two files, full paths and some other stuff omitted (this output is for the VS2010 toolset, but 2012 behaves the same):
1>Target "ClCompile" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.targets"...
Using "CL" task from assembly "Microsoft.Build.CppTasks.Win32, Version=4.0.0.0...
Task "CL"
Read Tracking Logs:
cl.read.1.tlog
CL.2520.read.1.tlog
...
Outputs for ....
XXX.OBJ
YYY.OBJ
...
xxx.cpp will be compiled as xxx.cpp was modified...
yyy.cpp will be compiled as yyy.cpp was modified...
Write Tracking Logs:
cl.write.1.tlog
CL.2520.write.1.tlog
...
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe ....
Tracking command:
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\Tracker.exe ....
xxx.cpp
yyy.cpp
Done executing task "CL".
1>Done building target "ClCompile" in project "xxx.vcxproj".
so far, so good. Now the linker kicks in (well, it doesn't):
1>Target "Link" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.targets"....
Using "Link" task from assembly "Microsoft.Build.CppTasks.Win32, Version=4.0.0.0...
Task "Link"
Using cached output dependency table built from:
link.write.1.tlog
Using cached input dependency table built from:
ink.read.1.tlog
Outputs for ....
MY.EXE
MY.PDB
All outputs are up-to-date.
Done executing task "Link".
Task "Message"
xxx.vcxproj -> my.exe
Done executing task "Message".
1>Done building target "Link" in project "xxx.vcxproj".
After checking all options we have in the property sheets one-by-one, it seems the sole source of this problem is that we have the intermediate directory set to a directory on another drive. We always do out of source builds in %TEMP%, and most of the time the projects reside on another drive.
Filed a bug report here including simple steps that reproduce the problem. Hopefully this gets fixed soon. Current soltuion is to set IntDir to a direcyory on the same drive as the project.
UPDATE
The bug report filed for this issue was closed as 'by design': it seems the Intermediate Directory should not be %TEMP% or %TMP% or any subdirectory of those. Disturbing, but at least I know what was wrong now.