Teambuild not copying XAP fiesl to _PublishedWebsites - msbuild

I have a TFS build for sivelright and it copies all the files in the web project to _PublishedWebsites, except the xap file. Error is
Web.csproj error MSB3021: Unable to copy file "Some.xap" to "c:\somewhere\Some.xap" Could not find file "Some.xap".
What it is trying to do, from where it is trying to copy and why it is failing?

Make sure your projects are built in the right order in your TFS Build Definition (Build Definition, Process, Required, Project to Build).

Related

The .csproj not able to copy .json files on Linux and macOS build servers after using Visual Studio 2019

I have ASP.NET Core 2.2 app and I've been developing with VS2017, when I started using VS2019 the first thing that happened was the sln stopped building with error pointing to my .csproj files, for example
Severity Code Description Project File Line Suppression State
Error NETSDK1022 Duplicate 'Content' items were included. The .NET SDK includes 'Content' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultContentItems' property to 'false' if you want to explicitly include them in your project file. For more information, see https://aka.ms/sdkimplicititems. The duplicate items were: 'plugin.json' ForkMeRibbon C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets 316
The cause is that in my csprojs I have certain .json files I need to be included at build time, so I have these lines in my .csproj file like below which worked fine with VS2017, but VS2019 complains. After I deleted these lines and everything worked in VS2019.
<ItemGroup>
<Content Include="plugin.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
Then however after I checked my code into github, the build servers of Azure Pipeline, AppVeyor and Travis CI are not happy, they complain that my "plugin.json" file is not found. After some struggling, I was able to fix the build for AppVeyor by changing image: Visual Studio 2017 to image: Visual Studio 2019 in the yml file.
It seems like the build servers are configured with VS2017-ish configurations, unless you tell it to use VS2019 compatible configurations it will not copy over my json file thus causing errors. So far all Windows builds are fine, but the Linux and macOS builds on Azure Pipeline and Travis CI are not, for example here is a failed build on Travis, and message error MSB3030: Could not copy the file "bin/Debug/netcoreapp2.2/plugin.json" because it was not found.
Has anyone else run into this issue and how did you solve it?

How to consume a VSTS artifact DLL from another pipeline in my VSTS MSTest pipeline

I am trying to use a DLL artifact from a developers build pipeline in my VSTS MSTest build pipeline. I need to reference this DLL but I get an error - Error CS0246: The type or namespace name 'Adv' could not be found (are you missing a using directive or an assembly reference?)
I am able to download the DLL's/Artifacts successfully to the agent using Download Build Artifacts option in my pipeline.
How can I get my build in the VSTS pipepline to use the downloaded DLL artifacts on the agent and get rid of this error?
I found out you need to use the copy files option to get the DLL's where you want them. I first tried \bin\debug but the problem there was the build creates these areas automatically and it overwrote my file copy. I noticed in the build log it was considering looking here for the DLL's - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0.
I updated the copy files to copy there and the solution builds just fine now.

TFS 2012 - binary files are not generated when using automatic build

I am newbie to TFS.
I am trying to automate process of build upon checking in the code in TFS.
I setup a Controller and an Agent. I created a new build definition and set a "build" and "drop" folder on c:.
I check in the code, expecting to see the generated dll files in "drop" folders. There's none, just "logs" folder. The "binaries" folder in "build" folder is also empty. Apparently the binaries are not being generated at all. How can I have MSBuild to generate the dll files?
They are generated when I compile the website locally on my development machine under "bin\" folder. The solution is comprised of two separate projects: "core" and "web" where "core" is referenced within "web".
Any thoughts?
What is the Summary showing of your build that ran? Or are there errors in your build? You can check the log of the build by opening the build in Visual Studio and then click View Log.

How to avoid having (or delete) PDB files in TFS 2012 build result

When using DefaultTemplate from Visual Sturdio 2012 (and TFS 2012 server), the PDB files are included in build directory. I do not want them.
Is there a way not to generate those files during build process?
Or
How can I delete those files?
I found this thread about deletion but seems a bit strange (no delete activity?)
There also is this answer but does not involve XAML template.
Thanks in advance for your help.
PDB files hold debug information on your code and its not advised to disable them, they are valid output hence deployment shouldn't be messing with them.
You can disable their generation in Visual Studio project Properties> Build > Advanced > Debug Info = none.
If you absolutely want them gone then disable them for build specific configuration (relaese etc.)
The build server by default does whatever the Solution (sln) tells it to. That by default is to do a "Debug" build and that created the PDB's. You can tell the Build to do a "Release" build that will not by default create any PDB's...
Figure: Adding a Build Configuration
I would however recommend against it as the PDB's contain information that you need even in production systems. Consider for a moment that you have a DLL in production and the customer is encountering a problem. You get them to create an InteliTrace log so that you can debug it locally (or they let you debug on their environment) and suddenly you are trying to debug without Visual Studio understanding the relationship between the Executable and the Source Code. So no debug...
Since I was unable to find building option to disable PDB file generation, I delete them afterwards.
There is no easy way to delete files. I did:
use a FindMatchingFiles Activity with wildcard *.pdb, which returns
a full path to pdb files
use a Foreach loop
call a DotNet method in the loop for each file with the InvokeMethod Activity,
with target type System.IO.File and method being "Delete"
In the previous version (Visual Studio 2010)
When we build /release, it was not generating PDBs, the PDB files are created when we only build with /debug:full or /debug:pdbonly, we use /debug:pdbonly if we want to generate PDBs for a release build that we do not want to be debuggable.
This is not the case in Visual Studio 2012, I checked it and I found it generated PDBs in both, /debug and /release
There is no documentation for Visuals Studio 2012.

DevForce Error when Run Custom Tool

When I right click on the T4 file and Run Custom Tool, I get the errors
Compiling transformation: Metadata file 'IdeaBlade.VisualStudio.DTE.dll' could not be found
Compiling transformation: Metadata file 'IdeaBlade.VisualStudio.OM.CodeGenerator.dll' could not be found
Compiling transformation: Metadata file 'IdeaBlade.EntityModel.Edm.Metadata.dll' could not be found
Thanks.
That error means that Visual Studio was unable to find some of the DLLs necessary to run DevForce's T4 generation. Probably the easiest way to solve this is by running the Dev Force installer. That will place the necessary DLLs in the GAC where Visual Studio will be able to find them.
I believe you can also add References to these specific DLLs on the project that contains your Data Model but I haven't done that because I prefer to have Dev Force installed on any machine that needs to run the T4s.