msbuild

How to tell TFS to deploy multiple webapps containing in one solution?

坚强是说给别人听的谎言 提交于 2019-12-17 22:35:29
问题 We have a single solution which contains one webapp project and some accompanying projects. Our TFS 2010 is building this solution every night and deploys the webapp to an IIS server. It runs like a breeze. In the Process tab of the TFS build definition you can specify the "MSBuild Arguments". This is the value which is set in our build definition (all in one line): /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True /p:MSDeployPublishMethod=WMSVC /p

run a custom msbuild target from VisualStudio

让人想犯罪 __ 提交于 2019-12-17 22:34:31
问题 Suppose I add a custom target to a csproj file. Is there a way to run that target from visual studio? I don't want it make it a prebuild or postbuild step, I just want to be able to run this target (and its dependencies) from visual studio. 回答1: There is a simple way (though not all that satisfying) using a custom external tool. Assuming your project file has the following modification: <Target Name="CalledFromIde"> <Error Text="Called from the IDE!" /> </Target> Go to Tools | External Tools

When should copy-local be set to true and when should it not?

≯℡__Kan透↙ 提交于 2019-12-17 22:11:57
问题 I am wondering if there are any heuristics for when to set copy-local=true for references? If referenced types are only used internally can I set copy-local to true but if referenced types are exposed as parameters or return values I set copy-local to false and indicate that a specific version of the dependency should be referenced when my library should be used? Can anyone clarify this for me? 回答1: Copy local is important for deployment scenarios and tools. As a general rule you should use

Relationship between the dotnet cli and the new vs2017 msbuild

只谈情不闲聊 提交于 2019-12-17 22:05:01
问题 With the move from project.json to the new csproj format introduced with VS2017, I'm struggling to understand the difference between the dotnet cli and the new msbuild and when to use one over the other. 1) To build a new csproj netstandard library from the command line, should I be calling the dotnet cli (for example dotnet restore dotnet build ) or use msbuild (for example msbuild ExampleNetstandard.sln ). 2) Also, my understanding is that there are two versions of msbuild , one built on

AfterPublish script doesn't run when I publish a web app

狂风中的少年 提交于 2019-12-17 20:36:04
问题 I've got an ASP.NET web app that I publish to our website when I make changes or fix bugs. We want to automatically save a backup of the project files to our server (separate from the SVN check in), so I wrote a batch file to copy the entire project from my local drive to the server. The batch file works properly when run stand alone, so that's not the problem. The batch file is not in the path of the project if that's a concern. Then I added these lines to my .csproj file right above the

Modular TeamBuilds

本秂侑毒 提交于 2019-12-17 19:55:31
问题 I have 3 TFS Builds (2 Dev and 1 Cert). I would like to modularize the builds so I don't have to edit 3 files each time I make a change to the common items. The problem I have is that Only the items in the build folder (under TeamBuildTypes) are automatically retrieved by the Team Build. I can put in code in my build process to get other files, but by then it is too late. Here is the scenario that I have. I make a "Common" location for common tasks. I then went and made changes to that file.

MSBuild: Custom.After.Microsoft.Common.targets for native C++ projects in VS2010

纵然是瞬间 提交于 2019-12-17 19:50:50
问题 I've read about the use of "Custom.Before.Microsoft.Common.targets" and "Custom.After.Microsoft.Common.targets" in order to execute a custom target before/after every project build and I would like to use this technique in order to change version info while building on our TeamCity build server. The problem is that although it works for C# projects, it doesn't seem to work for native C++ projects. After some digging around in the Microsoft.Cpp.targets file I found out that for native C++

How to pass TFS variable to a MSBuild task of the project [duplicate]

狂风中的少年 提交于 2019-12-17 19:48:50
问题 This question already has an answer here : How to get BuildNumber in .proj (MSBuild) using TFS server (1 answer) Closed 4 years ago . I have a solution which is built on TFS server. This solution includes several projects which have custom MSBuild tasks. Theses tasks actually create some zip archives. I need to extract somehow the $(Rev) macros from the TFS build and pass it to the tasks. I tried to use MSBuildArguments in the process tab of the build definition and it works when I set a

How to access the MSBuild 's properties list when coding a custom task?

余生长醉 提交于 2019-12-17 19:44:38
问题 I need to write a custom task that print all the defined properties (the non-reserved ones). So in my C# code, I wanna access to the properties list of MSBuild engine and I don't know how. Please help. 回答1: The previous example will lock you project file. This may cause problems. For example if you call the task several times in the same project file. Here is improved code: using System.Xml; using Microsoft.Build.Evaluation; using Microsoft.Build.Utilities; namespace MSBuildTasks { public

MSBuild task configuration property

末鹿安然 提交于 2019-12-17 18:48:53
问题 I have three Visual Studio solutions. The first is configured to build as Release , and the other two are set to build as Debug . When running a simple MSBuild script explicitly stating the configuration to build (Debug), the first project is still built as Release. Sample script: <Target Name="Build"> <ItemGroup> <ProjectToBuild Include="$(SolutionsPath)\Solution1.sln"/> <ProjectToBuild Include="$(SolutionsPath)\Core\Solution2.sln"/> <ProjectToBuild Include="$(SolutionsPath)\UI\Solution3.sln