msbuild-4.0

'dotnet build' error after migrating dotnetcore project to 1.0.4

送分小仙女□ 提交于 2019-12-12 09:47:40
问题 I've been trying to run the dotnet build command on a migrated .net core project (from 1.0.0-preview2-003131 to 1.0.4). I followed the steps for migrating the project mentioned here, and the solution builds using Visual Studio 2017. However, using the dotnet CLI command 'dotnet build' gives me the following error: C:\Program Files\dotnet\sdk\1.0.4\Microsoft.Common.CurrentVersion.targets(2867,5): error MSB4216: Could not run the "GenerateResource" task because MSBuild could not create or

Add output or transfer data from child to parent project

坚强是说给别人听的谎言 提交于 2019-12-11 19:20:00
问题 I use msbuild in main.proj to build a project like this: <MSBuild Projects="outs.proj" Targets="Build"> <Output ItemName="CustomOutputs" TaskParameter="TargetOutputs"/> </MSBuild> Inside outs.proj I have a custom Target, I need to add an output from this target to get .dll,.pdb,..., and .mycustomfiles How can I send data from child project to parent project ? Thanks in advance for your help. 回答1: I'd recommend you simply Import the dependant project, however the basic scenario you described

How to set a value for MSBuild property using PowerShell

蹲街弑〆低调 提交于 2019-12-11 08:18:52
问题 I have a property to specify the build drive: <PropertyGroup> <BuildDrive Condition="'$(BuildDrive)'==''">Y:</Group> </PropertyGroup> If I want to change the build drive using a batch file, I can do as follows: @echo off set buildDrive=H: :: Then call MSBuild Msbuild /t:BuildTarget %Projectfile% %Logger% Now I want achieve the same using PowerShell. I tried as follows in my PowerShell script, build.ps1: $BuildDrive=H: MSbuild /t:BuildTarget $ProjectFile $Logger But it is not honoring the

Parse ProjectDependency from .sln file

六月ゝ 毕业季﹏ 提交于 2019-12-11 07:18:06
问题 Project("{00000000-0000-0000-0000-000000000000}") = "Test Projects", "TestProjects", "{5FAF487E-B913-4D46-983E-CB13FDF36FCB}" EndProject Project("{11111111-1111-1111-1111-111111111111}") = "ProjPropHelperAPI", "ProjPropHelperAPI\ProjPropHelperAPI.vcxproj", "{22222222-2222-2222-2222-222222222222}" EndProject Project("{33333333-3333-3333-3333-333333333333}") = "ProjectPropertiesHelperAPI", "ProjectPropertiesHelperAPI\ProjectPropertiesHelperAPI.csproj", "{66666666-6666-6666-6666-666666666666}"

FTP Credentials for MSBuild.ExtensionPack.Communication.Ftp

余生长醉 提交于 2019-12-11 06:36:17
问题 In my AfterBuild script I use the following method to upload the files to the deployment server: <MSBuild.ExtensionPack.Communication.Ftp TaskAction="UploadFiles" Host="localhost" FileNames="$(SomeFolder)\$(FileToUpload)" UserName="myUserName" UserPassword="myPassword" RemoteDirectoryName="/" /> How can I load these credentials from a text file or an external source? What are the alternatives? I don't want to hard-code ftp credentials into my cproj files. I used GranadaCoders method to answer

Differences between building on a machine with VS2010 installed and on a machine with the 7.1 SDK installed

感情迁移 提交于 2019-12-11 04:30:50
问题 We are trying to upgrade our code base to use Visual Studio 2010 but are having problems getting everything sorted on our build servers. We do not want to install Visual Studio 2010 on our build servers and so have installed just the .Net 4 framework and SDK (v7.1). We are still wanting to target the .Net 3.5 platform (we will upgrade to .Net 4 at some point in the future but do not want to just yet). We have managed to get the code to compile but now we are running into runtime errors like

MsBuild- Delete files from a directory based on time modified / name

本小妞迷上赌 提交于 2019-12-11 01:19:50
问题 I have a list of files generated on each build inside a directory C:\BuildArtifacts The Contents of a directory looks like this: TestBuild-1.0.0.1.zip TestBuild-1.0.0.2.zip TestBuild-1.0.0.3.zip TestBuild-1.0.0.4.zip TestBuild-1.0.0.5.zip TestBuild-1.0.0.6.zip Now, with each incremental build, I just want to retain two recent artifacts and delete the rest. So, in this example, I want to retain TestBuild-1.0.0.5.zip and TestBuild-1.0.0.6.zip How can I do it with MSBuild? Note: I have managed

Encrypting password in a MSBuild file

≡放荡痞女 提交于 2019-12-10 17:38:55
问题 I want to encrypt the password I am supplying in the following code: <Target Name="Default"> <!-- Install a service on a Remote Machine --> <MSBuild.ExtensionPack.Computer.WindowsService TaskAction="Install" ServiceName="__TestService1" User="$(User)" Password="$(password)" ServicePath="c:\WINDOWS\system32\taskmgr.exe" RemoteUser="$(RemoteUser)" RemoteUserPassword="$(RemoteUserPassword)" MachineName="$(RemoteMachine)" /> </Target> I dont want to hardcode the password. How can I encrypt it?

How to override a configuration property?

泪湿孤枕 提交于 2019-12-10 14:46:55
问题 I am trying to do both Release and Debug builds on .Net v4.0, where I have a MSBuild project file rather than a solution file. I want to use the same build project file, but just override the Configuration property switching between "Debug" and "Release". When I execute as follows c:\windows\microsoft.net\framework\v4.0.30319\msbuild.exe buildinv.proj /target:rebuild "/property:Configuration=Debug" /verbosity:Diagnostic I get the following error c:\Windows\Microsoft.NET\Framework\v4.0.30319

Exec Task in MSBuild for execution of command on remote machine

青春壹個敷衍的年華 提交于 2019-12-10 12:19:43
问题 I am using following command to install a service via MSBuild file. This works great <Exec Command= 'c:\test\myService.Appservices.exe install' ContinueOnError='false' /> But the above command install the service on local machine. I want to install the service on a remote machine. How can I specify the machine name using this command? 回答1: As per Mike Vine's comment, MSBuild doesn't include tools for remote execution. You could however use something like psexec. e.g. <Exec Command='psexec