MSBUILD : error MSB1008: Only one project can be specified. Switch: '/p:RunOctoPack=true , in yaml pipeline - msbuild-task

MSBUILD : error MSB1008: Only one project can be specified.
Switch: '/p:RunOctoPack=true

Related

Building Xamarin.Forms iOS project from command line with msbuild

I'm trying to build a Xamarin.Forms iOS project via command line for CI/CD purposes directly on macOS:
msbuild C4S_MobileApp.iOS/C4S_MobileApp.iOS.csproj /restore /p:Platform=iPhone /p:ArchiveOnBuild=true /p:Configuration="Release" /p:BuildProjectReferences="false"
The problem is the shared app project which I avoid rebuilding with /p:BuildProjectReferences="false" and whose .dll can't be found:
CSC : error CS0006: Metadata file '/Users/c4s/Projects/c4s_refactored/c4s-refactored-mobile-app/C4S_MobileApp/bin/iPhone/Release/netstandard2.1/C4S.MobileApp.dll' could not be found [/Users/c4s/Projects/c4s_refactored/c4s-refactored-mobile-app/C4S_MobileApp.iOS/C4S_MobileApp.iOS.csproj]
MSBuild assumes the .dll in C4S_MobileApp/bin/iPhone/Release/netstandard2.1/ but it's in C4S_MobileApp/bin/Release/netstandard2.1. An ugly solution would be to copy the C4S.MobileApp.dll to that location. Building without /p:BuildProjectReferences="false" works because msbuild then creates C4S_MobileApp/bin/iPhone/Release/netstandard2.1/C4S.MobileApp.dll
I added the parameter /p:AssemblySearchPaths="C4S_MobileApp/bin/Release/netstandard2.1" to msbuild command and also added <AssemblySearchPaths>C4S_MobileApp/bin/Release/netstandard2.1;$(AssemblySearchPaths)</AssemblySearchPaths> to the C4S_MobileApp.iOS.csproj file under Release|iPhone configuration but it seems to be ignored by msbuild.
Folder structure:
c4s-refactored-mobile-app/
-> C4S_MobileApp/
-> C4S_MobileApp.iOS/
Thanks for your help and suggestions.
Unfortunately it's a bug in Xamarin.iOS: https://github.com/xamarin/xamarin-macios/issues/10308

Jenkins setup for xamarin froms app in mac build for ios

i am trying to setup jenkins job for xamarin.froms app and added msBuild plugin in jenkins configurations.
Create a job and trying to build the ios app, here is the build command i am using
msbuild /p:Configuration="Release" \
/p:Platform="iPhone" \
/p:IpaPackageDir="$HOME/Builds" \
/t:Build Sample.sln
build are failing saying that
MSBUILD : error MSB1009: Project file does not exist.
what is the exact command to build ios app ?
If you are using the MSBuild plugin you can do it like so:
Add the build step:
Add the following:
Select the MSBuild version from the drop down, this is set in your Jenkins Configuration.
The Path to your solution file from the root directory
The command line parameters (I removed the line escapes). I changed $HOME to %WORKSPACE%
You should have something like this:
If you want to just run the bash command, you will have to move to the directory with where the solution file is then run:
msbuild /p:Configuration="Release" /p:Platform="iPhone" /p:IpaPackageDir="$HOME/Builds" /t:Build Solution.sln
Make sure you have set the environment variable $HOME if that is where you want it to go
If not change $HOME/Builds to another path.

Setup Sonar properties files for multiple projects

I want to analyze multiple projects,and I would like to separate the two reports so i have one for the CA_Report package and one for the CallCenter package.I had tried the solutions from Setup sonar-runner for multiple java projects
and Sonar properties files
I tried to using sonar-project.properties to solve the following error,but it doesn't work with my following cmd.
Cmd
CD /D D:\trunk
SonarQube.Scanner.MSBuild.exe begin /k:"myProject" /n:"myProject" /v:"1.0"
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /t:Rebuild
Error
MSBUILD : error MSB1003:Specify a project or solution file. The current working directory does not contain a project or solution file.
I have a project that has the following package structure
-trunk(folder with sonar-project.properties)
-Center
-CA_Report(folder with source files)
-CA_Report.sln
-CallCenter(folder with source files)
-RBSolution.sln
-sonar-project.properties
My sonar-project.properties file looks as follows
sonar.host.url=http://localhost:9000
sonar.sourceEncoding=UTF-8
sonar.projectKey=FubonLifeCallCenterConfigureTest
sonar.projectName=FubonLifeCallCenterConfigureTest
sonar.projectVersion=1.0
sonar.sources=trunk/Center/CA_Report,trunk/Center/CallCenter
sonar.projectBaseDir=D:\\FubonLife\\trunk\\Center
sonar.modules=CA_Report,CallCenter
CA_Report.sonar.projectBaseDir=D:\\FubonLife\\trunk\\Center\\CA_Report
CA_Report.projectKey=CA_Report
CA_Report.projectName=CA_Report
CA_Report.sources=trunk/Center/CA_Report
CallCenter.sonar.projectBaseDir=D:\\FubonLife\\trunk\\Center\\CallCenter
CallCenter.projectKey=CallCenter
CallCenter.projectName=CallCenter
CallCenter.sources=trunk/Center/CallCenter

Visual Studio Online Build failing on TypeScript

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>

msbuild error: The property DirectoryName does not exist or was not found

This is my first attempt to configure an automated build on Visual Studio Online.
After creating a new build, I queued it to run. The first step was successfully completed (Get sources). Now I am experiencing and error in the build step. Here is a small snippet including the message:
782 2015-08-31T16:30:52.4324803Z Executing the powershell script:
C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\VSBuild\1.0.13\VSBuild.ps1
783 2015-08-31T16:30:54.0509690Z ##[error]The property DirectoryName
does not exist or was not found.
784 2015-08-31T16:30:54.1321607Z C:\Program Files
(x86)\MSBuild\14.0\bin\msbuild.exe "C:\a\5bc0b6a3\MySolution" /nologo
/m /nr:false /fl /flp:"logfile=C:\a\5bc0b6a3\MySolution.log"
/dl:CentralLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
/p:platform="any cpu" /p:configuration="debug"
/p:VisualStudioVersion="14.0"
785 2015-08-31T16:30:54.2859104Z MSBUILD : error MSB1009: Project
file does not exist.
I have searched for the DirectoryName string in the entire solution with no success and have now idea what it means.
Compilation works fine on my PC and I have no clue where to start looking at.
Any ideas?
You're missing the real error:
785 2015-08-31T16:30:54.2859104Z MSBUILD : error MSB1009: Project file does not exist.
You need to specify the path to a solution file. You can see that you're not:
C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
"C:\a\5bc0b6a3\MySolution" /nologo /m /nr:false /fl
/flp:"logfile=C:\a\5bc0b6a3\MySolution.log"
/dl:CentralLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
/p:platform="any cpu" /p:configuration="debug"
/p:VisualStudioVersion="14.0"
You can just specify **\*.sln for the "Solutions" parameter and it will discover and build all of the solutions in the workspace you mapped. If you need to get more specific, you can do that as well.
The folder in which the solution file is should be in or below one of the paths as defined in the mappings under the 'Repository' tab, otherwise the 'Project file does not exist' error will show up also.

Resources