My maven project is not building when placed in c:\program file while build is successful if placed in any other folder?
It throws error :
could not find main class files
most likely the root cause is Windows protecting C:\Program Files\ folder from unauthorized access. Only elevated programs can modify files under this folder. This could result in Maven being unable to create class files. I would expect it to complain sooner, however.
Related
My build fails with
Could not find a part of the path 'App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf'.
The file exists in in the file system
The file exists in Source Control
The get sources phase seems to find the file fine
2017-11-28T10:49:32.5448880Z Getting aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf (no errors here)
Things I've tried:
Excluding the file from the project
Deleting the file in visual studio and checking in
Deleting the file in Source Control Explorer and Checking in
Setting the file to copy if newer
Setting the file to copy always
Unticking build in configuration manager for the offending project
The error always comes back.
Copying App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf to obj\Release\Package\PackageTmp\App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf.
2017-11-28T10:50:48.4423213Z ##[error]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.targets(2603,5): Error : Copying file App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf to obj\Release\Package\PackageTmp\App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf failed. Could not find a part of the path 'App_Data\aspnet-Definiti.Licencing.TestWebProduct-20171016042403.mdf'.
My final act of sheer desperation was to remove the entire project so at least the rest of the solution would build, but to my utter surprise the error still remains.
The solution was to set the file to do not copy and clear the MSBuild Arguments in the build definition.
I added I new build step in TFS 2017 to pack my DLL into a nuspec (NuGet Packager).
My problem is that I can't manage to set the destination folder.
The description of the "Package Folder" is
Folder where packages will be created. If empty, packages will be
created alongside the csproj or nuspec file.
When I leave this field empty I expect it to be created in "$/MyProject/Common/" as described in the information. But it's keep creating it in the builder agent root folder. and adding "-OutputDirectory "C:_work\24\s"" even if I'm writting another folder in the package folder.
What am I doing wring here?
Is there a better way to pack and publish nuget for every release build in TFS?
NuGet Packager Log:
2017-04-02T15:01:51.3457383Z Set workingFolder to default: C:\agent\tasks\NuGetPackager\0.1.72
2017-04-02T15:01:51.3769893Z Executing the powershell script: C:\agent\tasks\NuGetPackager\0.1.72\NuGetPackager.ps1
2017-04-02T15:01:51.6426327Z C:\agent\agent\worker\tools\NuGet.exe pack "C:\_work\24\s\Common\Common.nuspec" -OutputDirectory "C:\_work\24\s" -version 1.0.17092.08
2017-04-02T15:01:52.0332823Z Attempting to build package from 'Common.nuspec'.
2017-04-02T15:01:52.1895494Z Successfully created package 'C:\_work\24\s\Common.1.0.17092.08.nupkg'.
Just specify the folder where you want to put the packages.
Package Folder
Specify the folder where you want to put the packages. You can use a
variable such as $(Build.StagingDirectory)\packages
Update
When you leave the folder empty, it will auto AddParameter of outputdir= builder agent root folder. When you enter $/MyProject/Common it will create the folder base on builder agent root folder/$/MyProject/Common
According to the powershell script located at C:\agent\tasks\NuGetPackager\xxx\NuGetPackager.ps1
$argsPack = "pack `"$fileToPackage`" -OutputDirectory `"$outputdir`" -Properties $buildProps";
So it will definitely put it in the agent root folder. Back to the description:
If you leave it empty, the package will be created in the same
directory that contains the .csproj or .nuspec file.
Not sure the same directory means be the same folder level or not. However the alongside seems mean the same folder level.
You could submit a bug either in GITHub-VSTS Tasks or Develop Community-Team Services both will get quick response by TFS develop team.
I Have Source Controller And Team Project My Build Process Is
and when i build i Got Access Denied Error Like This:
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (3678): Unable to copy file "C:\Builds\2\AcuatAgile\AcuatNFSBuild\src\AcuatAgile\Release001\Library\Kendo.Mvc.dll" to "C:\Builds\2\AcuatAgile\AcuatNFSBuild\bin\Kendo.Mvc.dll". Access to the path 'C:\Builds\2\AcuatAgile\AcuatNFSBuild\bin\Kendo.Mvc.dll' is denied.
and every time i got Access Denied To Different File DLL
I Searched The Net And Most Of The Answers are Clean WorkSpace As You Can See I Put True To Clean WorkSpace And I Got The Same Error in Build.
is there any other parameters to solve this problem?
Check the properties of bin folder to see whether it is read-only.
Try to add the following MSBUILD arguments in the build definition: /m:1 to make MSBUILD to use only one process to build.
I have a Visual Studio 2013 solution with the full Orchard source code. When I use "Publish..." on the "Orchard.Web" project in Visual Studio, it correctly publishes the site to the File System destination I've configured into the .PubXml file that I used.
However, if I build this site using Jenkins, the files do not get copied to the destination. I've created a separate PubXml file that is used by Jenkins.
In my Jenkins job, I have two Build steps of interest. The first uses the src\Orchard.sln file with a command line argument of /p:Configuration=Release. This runs correctly, and builds the entire solution.
The second Build step, immediately after, uses the Build File of src\Orchard.Web\Orchard.Web.csproj and these command line arguments:
/p:DeployOnBuild=true
/p:PublishProfile="D:\workspace\Site\trunk\src\Orchard.Web\Properties\PublishProfiles\Jenkins.pubxml"
/p:VisualStudioVersion=12.0
/p:Configuration=Release
/p:Platform=AnyCPU
/v:minimal
/nologo
/p:WarningLevel=1
With this, the build and deploy seems to work - but doesn't. Here are some lines from the build output:
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
Auto ConnectionString Transformed obj\Release\Package\PackageTmp\Shapes\Scripts\Web.config into obj\Release\CSAutoParameterize\transformed\Shapes\Scripts\Web.config.
(... about 200 more "Auto ConnectionString..." lines...)
Finished: SUCCESS
No where does it actually copy the files to the destination defined in the PUBXML file.
In contrast, in Visual Studio, the output looks similar, but transforms only 4 config files and includes lots of "Publishing folder x" lines:
(...)
Transformed Modules\SH.GoogleAnalytics\web.config using ....
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
Publishing folder /...
Publishing folder bin...
(etc.)
(I have installed the latest Windows Azure SDK for .NET on the Jenkins server.)
I have the same trouble,that work for me:
/t:Rebuild
/p:DeployOnBuild=true
/p:PublishProfile=Jenkins_Publish
/p:Configuration=Release
do not use /p:VisualStudioVersion=xxx
This is kind of old, but I actually just set up Orchard to be able to get built via command line and MSBuild. Here is what I did:
/p:VisualStudioVersion=12.0;PublishProfile="example-profile";DeployProjA=true;FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v4.5";Configuration=Release;PublishProfileRootFolder=c:\Workspace\src\Orchard.Web\Properties\PublishProfiles;Password=ExamplePass
Since you are using Orchard you want to make sure that only the Orchard.Web project gets published so do not use DeployOnBuild=true. This will attempt to deploy every web project in the solution, which is a lot for Orchard. Instead follow the guidelines here to see how to deploy only the web project: http://sedodream.com/2013/03/06/HowToPublishOneWebProjectFromASolution.aspx
I have TFS 2010 and for one of the team project I have created the build definition (used default build template) and added the solution of one of the project. But when try to create build getting the following error:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets
(902): The command "if Debug == Debug copy
"C:\Builds\14\\\Sources\ServerObjects..\SharedInterfaces\bin\debug*.dll"
"C:\Builds\14\\\Sources\ServerObjects..\ServerObjects\bin\debug"" exited with
code 1.
I think you maybe has wrong folder structure on the source control, see my answer on similar question here
teambuilding and deploying a dll (e.g. wpftoolkit.extended.dll)
TeamBuild overrides the output folder so the bin\debug (or bin\release) folder won't exist. It collates the output into Binaries.
For your custom build step use the obj folder instead of bin as that'll be the same under both TeamBuild and the local machine build.