Jenkins and MSBuild Error - jenkins

I am having an issue with building a sln on Jenkins. I know what the problem is I just have no idea how to fix said problem. So the sln imports a project that is not located in the same folder as the sln. This is not an issue with other sln files that we do the same thing with. As you can see below instead of .. to get back to parent directory it is a looking for a .. directory which obviously doesn't exist.
D:\Path\To\sln\OurSolution.sln.metaproj : error MSB3202: The project file
"D:\Path\To\sln\..\..\PathTo\SharedProject\Shared.csproj" was not found
[D:\Path\To\sln\OurSolution.sln]

Edit your .sln file and have it point to the .csproj file that does exist.
Also, double check your working directory to make sure it's the directory where the solution exists.

Paths in the .sln file need to be relative to the location of the .sln file so that when Jenkins can checks out the entire solution into its workspace from source control the paths resolve.
Check that the paths in the solution file are indeed relative to the solution file.
Check that all the project files defined in the solution file (and all their files in turn) are indeed being checked out to the Jenkins job workspace folder.
Where is the shared project in source control in relation to your solution file? Is it in the same repository? If it isn't then my bet is your Jenkins job isn't checking it out from source control into its workspace and therefore not finding it when the solution tries to compile.
Paths your sln and csproj files are relative. .sln and .csproj files paths are relative from where the sit on the file system.
Usually you would expect csproj files to exist in immediate subdirectories of the directory where the .sln file sits.

Related

TFS 2017 build Copy files from

In a build, we have Copy files from the task. The problem we have is the source folder itself is copied to the destination. We'd want the contents of the source folder to be copied to the destination folder, not the folder itself. Is there any way to do that?
I tried a wildcard but that doesn't work. It seems it needs a path itself. An issue of this could be that the source is named 'X' but the destination is named 'Y' (it was setup before this build and IIS is pointing to this folder). Can we have the source folder be renamed in the build maybe?
That would be name_of_sourcefolder\**\* for all files and subfolders of just name_of_sourcefolder\* for all files.
This has to be set in the Contents part of the task.

Jenkins: Copying Artifact (directory) from one Job to another

in Jenkins, I have a job downloadAgents that is responsible of creating a folder and populating it with some files. Then the folder is saved as an artifact with the following folder structure
dev\downloadAgents\target\dependency\ios
Then I need to copy the contents of the ios folder into the workspace of another job (into a specific folder).
I have added the Copy artifacts from another project step. And it does copy the artifacts, but it copies the full path
\dev\downloadIosAgents\target\dependency\ios
How can I tell jenkins to copy only one folder ios and everything that is inside it and, do not copy all folders that are before ios.
Also if there are already files in the destination folder, will it merge the 2 folders?
You can use regex for your copy (under "Artifacts to copy")-
dev\downloadAgents\target\dependency\ios***.*
** - all folders under ios
*.* - all file types
You can also specify the target directory, and you also have a flag for "Flatten directories". This will move all the files without the hierarchy of the folders (flat to your target directory)
Feel free to look at the plugin's home page:
https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin
In CopyArtifacts plugin specify the pattern: \dev\downloadIosAgents\target\dependency\ios\*.* or \dev\downloadIosAgents\target\dependency\ios\** - I don't remember exactly.
That should do the job.

TFS- 2013 auto build Cloaked folder is giving not found issue

Status Source Control Folder Build Agent Folder
Active
$/project111/Dev/Source/Product111_UI
$(SourceDir)
Cloaked
$/project111/Dev/Source/Product111_UI/kendoUI/Modules/Sample
above are the my work space settings from build configuration.
It is giving below issue while copying build.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets (182): Could not copy the file "Modules\Sample\AliasConfig\AliasConfig.html" because it was not found.
do I missed any configurations still, please help me out in this. if any
solution.
It looks like you have a reference to the output of that .html fil le somewhere in your build logic. Cloaking the folder means that it is not there so the error is correct.
You need to find where you have a reference to that .html file in your build logic.

TFS Build single folder not being copied

when building my app on a TFS server, a single folder (with 2 .xml files) aren't copied to the output folder, but all others are.
These files are: a normal xml file and it's tranform version,
This is on the corporate TFS build server and it works for all other files / transformations. So it must be one of my settings in this project / File.
I've checked the files, it's set the same as a .css file that is getting copied (so set to content)
anyone has an idea where I could have a look to find why this is happening?
or even better has a solution for me.
Found that WIX was removing this file

Teamcity is not copying all the folders

I've now setup a MSBuild script to create the folders and files I need in the right structure for my MVC project. I'm then setting Teamcity up to look at the folder with only the files I want to have and copy that to the artifacts folder. So far, so good!
However, There is a few folders in the structure that are empty, and Teamcity does not copy these folder, even if I've set it up to copy the mainfolder and everything in it.
Is there a way to force Teamcity to copy everything - and by that I mean EVERYTHING in my folder, or does it simply not work?
Teamcity Artifact path settings:
Website => Release
You may find your answer in this post : How do I exclude the contents of a directory but not the directory itself in MSBuild
It's not Teamcity but still MsBuild. The problem is that msbuild's include does not include empty directories...
We manage to work around this and skip the empty folders. Therefore this was no longer an issue. However, still don't know how to copy empty folders. My understanding from doing research for a long while now is that it simply doesn't work.

Resources