Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

Thursday, 3 May 2012

PhoneGap (Cordova), fail to navigate to index.html

Noticed when debugging Windows Phone 7.1 or 7.5 Mango app made with PhoneGap (Cordova) 1.6.1. The same may apply to earlier versions. Visual Studio 2010.

Error 1: fails to build with the following error


Arg :: path to project\MyProject.csproj
path to solution\ MyProject\BuildManifestProcessor.js(14, 1) Microsoft JScript runtime error : Permission denied
  
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1036,5): error MSB3073: The command "CScript "path to project\ MyProject\/BuildManifestProcessor.js" " path to project\ MyProject\ MyProject.csproj"" exited with code -1.

Reason: CordovaSourceDictionary.xml in the root of the project is read-only. Happened because it was included in the project and then added to source control.
Fix: Make sure that CordovaSourceDictionary.xml is not read-only before doing the build


The file CordovaSourceDictionary.xml  is dynamic, generated on each build by a pre-build event

However, if this file is excluded from the project, you will experience

Friday, 30 September 2011

Team Build fails to find Microsoft.Web.Deployment when running Web Deployment target


While compiling perfectly fine on developer's local machine, Team Build for an ASP.Net project may fail on a build server with a failure to load Microsoft.Web.Deployment assembly



Possible Solution:
Download and install Web Deploy 2.0 Refresh for your platform. This version can coexist with previous, 1.1 version.


x86: http://go.microsoft.com/fwlink/?LinkId=209115
x64: http://go.microsoft.com/fwlink/?LinkId=209116


Error:

Target "CheckAndCleanMSDeployPackageIfNeeded" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets" from project ".....csproj" (target "GenerateMsdeployManifestFiles" depends on it):
Using "IsCleanMSDeployPackageNeeded" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll".
Task "IsCleanMSDeployPackageNeeded"
  Failed to load this version Microsoft.Web.Deployment (8.0) reason:Could not load file or assembly 'Microsoft.Web.Deployment, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
   Trying the next one specified in $(_MSDeployVersionsToTry)..
  Failed to load this version Microsoft.Web.Deployment (7.5) reason:Could not load file or assembly 'Microsoft.Web.Deployment, Version=7.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
   Trying the next one specified in $(_MSDeployVersionsToTry)..
  Failed to load this version Microsoft.Web.Deployment (7.1) reason:Could not load file or assembly 'Microsoft.Web.Deployment, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
   Trying the next one specified in $(_MSDeployVersionsToTry)..
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: The "IsCleanMSDeployPackageNeeded" task failed unexpectedly. [.......csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object. [......csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018:    at Microsoft.Web.Publishing.Tasks.Common.Utility.CheckMSDeploymentVersion() [......csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018:    at Microsoft.Web.Publishing.Tasks.Common.Utility.get_IsMSDeployInstalled() [......csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018:    at Microsoft.Web.Publishing.Tasks.Common.Utility.CheckMSDeploymentVersion(Task task) [.....csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018:    at Microsoft.Web.Publishing.Tasks.IsCleanMSDeployPackageNeeded.Execute() [.....csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [......csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2850,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) [......csproj]
Done executing task "IsCleanMSDeployPackageNeeded" -- FAILED.
Done building target "CheckAndCleanMSDeployPackageIfNeeded" in project ".....csproj" -- FAILED.
Done executing task "CallTarget" -- FAILED.






Tuesday, 27 September 2011

WiX, Troubleshooting "Verify that you have sufficient privileges to install system services" error message



When running an installer created by using WiX (Windows Installer XML), you may sometimes get the following error: Service 'Service Display Name' (ServiceName) could not be installed. Verify that you have sufficient privileges to install system services.


This error message, like many other in WiX is totally misleading - it is not about YOUR privileges, it is about how service account is resolved
The WiX ServiceInstall element is used to install Windows services. Its Account attribute should contain the name of the windows account that this windows service is supposed to run under.
This windows user name must be fully qualified - either as a domain or as machine name. This is true even for local accounts.
The solution is to set Account attribute like this:  <ServiceInstall ... Account=".\MyWindowsUser" .... />
Not like this: <ServiceInstall .... Account="MyWindowsUser" .... />



Monday, 26 September 2011

Team Build, fixing the "Unable to determine the workspace" error

When running the Team Build on Team Foundation Server 2008 you may get the following error in your build log (replaced file paths with dummy PATHTOMYFILE, etc):


Error:

Using "Exec" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Exec"
  "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\..\tf.exe" get /force /noprompt "PATHTOMYFILE"
  Unable to determine the workspace.
PATHTOBUILDFILE\BuildType\TFSBuild.proj(60,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\..\tf.exe" get /force /noprompt "PATHTOMYFILE"" exited with code 100.
Done executing task "Exec" -- FAILED.


Solution:
A) make sure you have a workspace mapping for your build computer and for the windows account under which team build agent runs
B) Remote desktop to your build server under the build account and run the following from the command line
@echo off

SET TFPATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\tf.exe
echo Listing the workspaces for %USERNAME%
"%TFPATH%" workspaces /s:http://BUILDSERVERNAME:8080 /owner:%USERNAME%


echo Press any key now to refresh workspaces or close the window to exit
pause


"%TFPATH%" workspaces /s:http://BUILDSERVERNAME:8080
echo Done!
pause






Wednesday, 21 September 2011

VS2008 SP1 may break the Team Foundation Build

Installed VS2008 SP1 on a build server where there was Team Build Agent installed. Started to receive the following error when running the build:


C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(300,15): error MSB4131: The "Reason" parameter is not supported by the "GetBuildProperties" task. Verify the parameter exists on the task, and it is a gettable public instance property.

The reason was that the Tasks assembly was not updated - it is located here:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.Tasks.dll along with some other dlls. For SP1, its version should be 9.0.30729.1, modified in 2008, while in my case it was some lower version.

The solution is to install Team Foundation Server 2008 SP1, which is 133 megs and can be downloaded from here: Team Foundation Server 2008 Service Pack 1 (SP1)