msbuild

Running MSBUILD through code and getting asynchronous progress

蓝咒 提交于 2019-12-22 18:01:11
问题 I am wanting to run MSBUILD through code, and get asynchronous status of the build as it progresses (similar to TeamCity or any other build runner does). I am using the following code: var projectFileName = @"...\MyApplication\MyApplication.sln"; ProjectCollection pc = new ProjectCollection(); var GlobalProperty = new Dictionary<string, string>(); GlobalProperty.Add("Configuration", "Debug"); GlobalProperty.Add("Platform", "x86"); var buildRequest = new BuildRequestData(projectFileName,

MSBuild SonarQube runner skipping auto-generated files?

帅比萌擦擦* 提交于 2019-12-22 17:39:15
问题 I have set up a local SonarQube 5.1.1 server. I have also installed the C# plugin (version 4.1), as well as the MSBuild runner (version 1.0). I then performed two separate runs on the .NET codebase for the project I am currently working on: Using sonar-runner and the C# plugin Using the MSBuild runner Both runs were made through the CLI. However, the runs yielded very different results. Here is an example: In the first run SonarQube calculated the number of code lines to be roughly 956 000,

How can I generate Visual Studio projects for a specific configuration?

折月煮酒 提交于 2019-12-22 14:51:52
问题 Using CMake's ExternalProject_Add , I automate builds of my dependencies. However, I build configurations don't match in the end even though I pass CMAKE_BUILD_TYPE and BUILD_SHARED_LIBS as described in the Tutorial. # SFML include(ExternalProject) set(SFML_PREFIX ${CMAKE_SOURCE_DIR}/SFML) # Download, configure, build and install. ExternalProject_Add(SFML # DEPENDS PREFIX ${SFML_PREFIX} TMP_DIR ${SFML_PREFIX}/temp STAMP_DIR ${SFML_PREFIX}/stamp #--Download step-------------- GIT_REPOSITORY

CordovaApp.Windows.jsproj(70,3): error MSB4019: The imported project

时间秒杀一切 提交于 2019-12-22 14:12:13
问题 Full error log: C:\Users\user\Development\Tutorials\cordova-tutorial\hello\platforms\windows\CordovaApp.Windows.jsproj(70,3): error MSB4019: The imported project "C:\Program Files(x86)\MSBuild\Microsoft\VisualStudio\v14.0\Microsoft.VisualStudio..Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1 While doing Create your first app

How to point to a different project.json location in a .NET Core PCL?

▼魔方 西西 提交于 2019-12-22 11:37:16
问题 Say you have a .NET Core PCL that's supposed to compile for multiple platforms. Since csproj-based projects only support compiling for one platform at a time, you can't have a shared project.json . Thus, your directory structure looks like this: LibFoo | ---- LibFoo.csproj | ---- Platforms | ---- net45 | | | ---- project.json | ---- netcore451 | ---- project.json You also have two MSBuild target platforms: Net45 and NetCore451 . When building for Net45 you want to include the project file in

MSDeploy Package has Missing Files

谁都会走 提交于 2019-12-22 11:33:13
问题 I'm using MSBuild to build a web application project and adding parameters to create the package file. All of that is good. I get two folders in the _PublishedWebSites output: AppName AppName_Package In the ApplicationName folder, the entire site is there and I can simply copy this folder over to the website and it will run. In the Package folder I've got the expected 5 files: AppName.deploy.cmd AppName.-readme.txt AppName.SetParameters.xml AppName.SourceManifest.xml AppName.zip When

Opening a solution with msbuildworkspace gives diagnostics errors without details

*爱你&永不变心* 提交于 2019-12-22 11:18:44
问题 I am trying to analyse a solution with Roslyn, with MSBuildWorkspace. The solution is a new solution, with 2 class library projects in them, one referencing the other. They are created in Visual Studio 2017, .Net 4.6.2. When I open the solution, I receive two generic errors in workspace.Diagnostics, both are : Msbuild failed when processing the file ' PathToProject ' There is nothing more in the diagnostics or output window, to indicate WHY it failed to process the project file. The code for

VCBuild task in MSBuild - change outputpath

徘徊边缘 提交于 2019-12-22 10:56:22
问题 I'm attempting to write an automated build for one of our products, and I've hit up against a wall for some of our VC++ projects: I need to be able to set the output path to where the assemblies will be copied once its done. Here is a makeshift msbuild file: <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <Target Name="Build"> <VCBuild Projects="C:\src\SomeProject\SomeProject.vcproj" ToolPath="C:\Program Files\Microsoft Visual

How to extract compilation args for each compilation unit in a vcxproj?

冷暖自知 提交于 2019-12-22 10:52:46
问题 I'm trying to get the compilation args for each compilation unit so I can create the "compilation_commands.json" for my vcxproj that can be used with clang's libTooling. The libTooling tutorial suggests using a CompilationDatabase to provide the compilation args for all the cpp files in a project. The tutorial shows that CMake can generate the compilation_commands.json for CMake based projects. Since clang can be put into "MSVC mode" via clang.exe --driver-mode=cl or clang-cl.exe my thought

When implementing a microsoft.build.utilities.task how to i get access to the various environmental variables of the build?

天大地大妈咪最大 提交于 2019-12-22 10:48:10
问题 When implementing a microsoft.build.utilities.task how to i get access to the various environmental variables of the build? For example "TargetPath" I know i can pass it in as part of the task XML <MyTask TargetPath="$(TargetPath)" /> But i don't want to force the consumer of the task to have to do that if I can access the variable in code. http://msdn.microsoft.com/en-us/library/microsoft.build.utilities.task.aspx 回答1: I worked out how to do this public static class BuildEngineExtensions {