Error VS 2015 CTP 6 + Cordova + Windows 10 Technical Preview for Phones - visual-studio-cordova

I am able to create and run a Blank App (Cordova Cordova) on windows 10 phone technical preview. The app is installed on the phone, appears in the app list and runs. However, I get the following error in Visual Studio 2015 CTP 6 Severity Code Description Project File Line
Error ERROR: Error code -2146233087 for command: C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\Xap Deployment\XapDeployCmd.exe with args: /installlaunch,D:/erase/BlankCordovaApp2/BlankCordovaApp2/bld/Debug/platforms/wp8/Bin/debug/CordovaAppProj_Debug_AnyCPU.xap,/targetdevice:0

One workaround to this might be to unplug the phone from your machine, plug it back in, and try the WP8 deploy again without doing an 8.1 or 10 deployment.
If it doesn't help, can you look at your detailed build for any build failures messages? You can turn on the detailed output from Tools --> Options --> Project and Solutions --> Build and Run settings.

I just realized I had NPM and Gulp files in my Blank Cordova app. I created a new Blank Cordova app and no errors appear when I build the app in VS. There seems to be a problem with the node-modules folder. I am able to prevent the error from occurring by removing just the node_modules folder that's created by Gulp or Grunt file in the Visual Studio Project. The output build message provides some detail(see below). Fortunately, the error is now gone, but that doesn't solve my new problem with the node_modules folder.
2> Deploying package to Device
2> Done.
2>ERROR: Error code -2146233087 for command: C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\Xap Deployment\XapDeployCmd.exe with args: /installlaunch,D:/erase/BlankCordovaApp2/bld/Debug/platforms/wp8/Bin/debug/CordovaAppProj_Debug_AnyCPU.xap,/targetdevice:0
2> Command finished with error code 2: D:\erase\BlankCordovaApp2\bld\Debug\platforms\wp8\cordova\run.bat --nobuild,--target=Device,--debug
2>
2>ERROR: Error code -2146233087 for command: C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\Xap Deployment\XapDeployCmd.exe with args: /installlaunch,D:/erase/BlankCordovaApp2/bld/Debug/platforms/wp8/Bin/debug/CordovaAppProj_Debug_AnyCPU.xap,/targetdevice:0
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

Related

Assets file project.assets.json doesn't have a target for 'net6.0-windows10.0.19041.0/win-x64'

I have a .NET 6 Windows Desktop app that I deploy with MSIX.
I can run and debug it on my own computer, but it fails to build with Azure Pipelines YAML.
I get the error:
C:\Program
Files\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5):
error NETSDK1047: Assets file 'D:\a\1\s\MyApp\obj\project.assets.json'
doesn't have a target for 'net6.0-windows10.0.19041.0/win-x64'. Ensure
that restore has run and that you have included
'net6.0-windows10.0.19041.0' in the TargetFrameworks for your project.
You may also need to include 'win-x64' in your project's
RuntimeIdentifiers.
App project file:
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<Platforms>x64</Platforms>
Installer project file:
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
The pipeline task is VSBuild with Visual Studio 2022 (v. 17)
Nuget tool is version 6.0 installed with NugetToolInstaller task.
Azure Windows agent uses vmImage: 'windows-2022'
The error says:
Ensure that you have included 'net6.0-windows10.0.19041.0' in the
TargetFrameworks for your project. You may also need to include
'win-x64' in your project's RuntimeIdentifiers.
I have added 'net6.0-windows10.0.19041.0' in the TargetFramework for both the app and the installer projects.
If I replace win10-x64 with win-x64 it can build, but I need to use win10-x64 because one of the packages requires it (Microsoft.PowerShell.SDK with System.Management.Automation).
NEW:
After adding /p:RestoreLockedMode=true in the VS Build task, I now get the error:
MyApp.Installer.wapproj : error NU1004: The project MyApp has no
compatible target framework. The packages lock file is inconsistent
with the project dependencies so restore can't be run in locked mode.
Disable the RestoreLockedMode MSBuild property or pass an explicit
--force-evaluate option to run restore to update the lock file.
NEW NEW: I upgraded to .NET 7 but get the same error.
How do I fix the error?

My ASP.Net Application is failing to build but no error shown

I am trying to build and publish my project and all of a sudden, it will no longer build. Just a note, my computer did shut down during a publish to Azure so maybe that has something to do with it? Anyways, I am trying to just build my project, and it is no longer building but I am given no error message as to why it is not building. I tried clearing my nuget cache and I still get a failed build:
Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the NuGet Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
Running restore with 4 concurrent jobs.
Reading project file C:\Users\sagarpatel\Statum\Workspace\Full\StatumHealth\StatumHealth.csproj.
Reading project file C:\Users\sagarpatel\Statum\Workspace\Full\StatumHealth\StatumHealth.csproj.
The restore inputs for 'microsoft.visualstudio.web.codegeneration.tools-netcoreapp2.1-[2.0.2, )' have not changed. No further actions are required to complete the restore.
The restore inputs for 'StatumHealth' have not changed. No further actions are required to complete the restore.
Committing restore...
Tool assets file has not changed. Skipping assets file write. Path: C:\Users\sagarpatel\.nuget\packages\.tools\microsoft.visualstudio.web.codegeneration.tools\2.0.2\netcoreapp2.1\project.assets.json
No-Op restore. The cache will not be updated. Path: C:\Users\sagarpatel\.nuget\packages\.tools\microsoft.visualstudio.web.codegeneration.tools\2.0.2\netcoreapp2.1\microsoft.visualstudio.web.codegeneration.tools.nuget.cache
Restore completed in 44.27 ms for C:\Users\sagarpatel\Statum\Workspace\Full\StatumHealth\StatumHealth.csproj.
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: C:\Users\sagarpatel\Statum\Workspace\Full\StatumHealth\obj\project.assets.json
No-Op restore. The cache will not be updated. Path: C:\Users\sagarpatel\Statum\Workspace\Full\StatumHealth\obj\StatumHealth.csproj.nuget.cache
Restore completed in 41.29 ms for C:\Users\sagarpatel\Statum\Workspace\Full\StatumHealth\StatumHealth.csproj.
NuGet Config files used:
C:\Users\sagarpatel\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
https://api.nuget.org/v3/index.json
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
1>------ Build started: Project: StatumHealth, Configuration: Debug Any CPU ------
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Any suggestions on how to fix this? I am not shown any errors or incompatible packages and this is preventing me from publishing my project.

Cordova application build error

We are getting below error while Re-build cordova application, we also tried warning message clear cache activity but still facing issue.
Severity Code Description Project File Line Suppression State
Error BLD401 Error : BLD00401 : Could not find module '..\node_modules\vs-tac\app.js'. Please Go to Tools --> Options --> Tools for Apache Cordova --> Cordova Tools --> Clear Cordova Cache and try building again.
We have fixed this issue with below steps.
Got to--> C:\Users[your user name]\AppData\Roaming\npm\node_modules
Removed--> vs-tac folder
open command prompt and run:
npm install -g "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac"
Cleaned solution with re-build

GIT based asp.net web app fails to deploy to Azure with typescript compile error

I have this asp.net (4.6.2) web application which compiles and runs fine on my local machine.
The project is in a Git repo in VSTS.
I want this site deployed to Azure web sites. So I make a Webapp and set the deployment option to my VSTS Git repo.
This will automatically trigger a deployment... which fails.. with this error:
All packages listed in packages.config are already installed.
D:\home\site\repository\FormBuilder\Scripts\typings\knockout\knockout.d.ts(335,13): error TS1110: Build: Type expected. [D:\home\site\repository\FormBuilder\FormBuilder.csproj]
D:\home\site\repository\FormBuilder\Scripts\typings\knockout\knockout.d.ts(338,11): error TS1109: Build: Expression expected. [D:\home\site\repository\FormBuilder\FormBuilder.csproj]
D:\home\site\repository\FormBuilder\Scripts\typings\knockout\knockout.d.ts(339,1): error TS1128: Build: Declaration or statement expected. [D:\home\site\repository\FormBuilder\FormBuilder.csproj]
Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\repository\FormBuilder\FormBuilder.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\8d3e9219d2f6f3b";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="D:\home\site\repository.\"
An error has occurred during web site deployment.
It looks to me like it's compiling my .d.ts files. Don't know why..VS2015 does not do that.
I tried to exclude this file in a tsconfig but that does not work.
How can I make this build succeed?
So the problem is that the Azure build machine is not equipped with typescript 2.0 (yet) and knockout.d.ts uses a 2.0 syntax for something. See the comments below the question.
GitHub issue here
You need to compile type script files before deploying to azure. In deploy.cmd file on azure you can add this code to Compile TypeScript right after the npm packages are installed.
echo Transpiling TypeScript in %DEPLOYMENT_TARGET%...call :ExecuteCmd node %DEPLOYMENT_TARGET%\node_modules\typescript\bin\tsc -p "%DEPLOYMENT_TARGET%"
You can find the deploy.cmd file on KUDU in site->deployments->tools section.

in Visual Studio 2013, Build succeeds but Publish fails with no details

I've inherited a small webapp that was previously managed by one owner. It has been published many times before me, but I am having problems doing it myself.
on trying to publish:
1>------ Build started: Project: Foo.Logic, Configuration: Release Any CPU ------
1> Foo.Logic -> C:\workspace\Foo\Foo.Logic\bin\Release\Foo.Logic.dll
2>------ Build started: Project: Foobar, Configuration: Release Any CPU ------
2> Foobar -> C:\workspace\Foo\Foobar\bin\Foobar.dll
3>------ Publish started: Project: Foobar, Configuration: Release Any CPU ------
========== Build: 2 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
I've tried doing diagnostic for output, but that doesn't give me any details of why publish is failing. No files are written at all and I don't get a single message in Output about it trying to publish.
I've already tried quite a few links, both here and elsewhere.
Things I've done/tried so far:
Restarted VS
Rebooted computer
deleted the contents of the destination directory (no change)
published to a local directory (failed)
published an empty/default webapp (it worked)
Deleted source and re-cloning from git
Precompiling (although I'm not sure if I'm doing it right)
Publish settings:
Publish method: File System
Configuration: Release - Any CPU
I talked with the previous owner of the webapp and he said it was due to a broken Visual Studio template.
The workaround solution was to build and then xcopy to the target filesystem.
My previous workaround was to ask my fellow coworker (who did not have this issue with publishing F# webapps) to publish for me.
I resolved this issue by deleting all of the files and folders under obj\Release in Visual Studio.
I think this may have been caused by old references to some of the files which were no longer required by the project.

Resources