I have some failing builds and the build data is missing from the emails sent from CCNET?
It contains tests run and modifications but no build or error data?
I don't think I have messed up the xsl's.. any thoughts?
UPDATE :
Yes i've looked at
http://confluence.public.thoughtworks.org/display/CCNET/Email+Publisher
and Yes in the publishers section i've called xmllogger before email
UPDATE :
I'm not sure if this means anything but.. in the compile.xsl it looks for
/cruisecontrol//buildresults//message
but there is no 'buildresults' node??
It just goes..
cruisecontrol --> build --> msbuild (then warnings, project, messages etc etc)
UPDATE :
Have the following in ccservice.exe.config. No mention of msbuild??
xsl\header.xsl
xsl\compile.xsl
xsl\unittests.xsl
xsl\fit.xsl
xsl\modifications.xsl
xsl\fxcop-summary.xsl
-- Lee
I had a similar problem yesterday with a new install of cruisecontrol as a service.
Make sure you have specified the correct xsl files in the ccnetservice.exe.config (if you are running the service) and ccnet.exe.config if you running the console version.
you need to restart the service/console app once these are updated.
HTH
Edit:
Are you using the standard msbuild logger, or Rodemeyer's one? If you are using Rodemeyer's, you need to use diffrent XSL transforms (msbuild2ccnet.xsl) to normal (compile.xsl, msbuild.xsl). There is a guide for that here
Check that your output is making it to the build log, located in server\<projectName>\artifacts.
If you have modified the xsl, make sure its in the correct folder (webdashboard\xsl and server\xsl). You can test the xsl works fine by copying the build log file (see server\<projectName>\artifacts directory). to a file, and adding the relevant XSL includes to the header then opening the XML file in a web browser)
EDIT:
in the <xslFiles> section of ccservice.exe.config, add another line like this:
<file name="xsl\compile-msbuild.xsl" />
or
<file name="xsl\msbuild.xsl" />
as i am not using the standard logger (you are though), i am uncertain as to which of those is needed. try one, then if that doesnt work, try the other!
Related
I'm still trying to create my first Azure Pipeline CI / CD. My CI part is working fine, my CD is also working except I cannot apply my Web.config file transformations.
Let me first show you what I have then I will ask several questions below. The build with generated artifact. I also copy manually my 3 config files.
Wen I open my WebAPI.zip file here is the path and content:
Here is my pipeline project
And the details of my staging phase:
When I run this full pipeline my config file is never transformed but I get no error. I just get a
2019-05-02T03:27:23.5778958Z ##[warning]Unable to apply transformation
for the given package.
I also have the debug log with full information but it doesn't give me much information for now. I will add it here later.
Questions
Azure Pipeline File Transformation is not working. Why?
Is it because the File Tranform task only look for config file in zip?
Is this system then just ignoring my tranformation file in root of artifact?
So I think my manual copy of config transformation file is obsolete?
How can I then add my transformation file into my zip?
In my csproj I already set all my tranformation files on Build action content, copy always, this is ignored too, is it normal?
EDIT 1
One more important question: Is it possible to simply ask the deployment system to ignore or not deploy my config file. It is not something I want to deploy every time. I like the idea I have to do it manually or from alternative deployment system. With this solution I can have some other issues if I save a version or build variable in my config file. Then is it possible to modify a already deployed file after deployment? I'm looking for workaround here. Example: I read a value in my existing config file then I increment this value by one or simply replace this value with another?
EDIT 2
I'm now able to add the config file to the WebApi.zip package on root and/or in bin folder. I followed the comment of Shayki Abramczyk bu using the xml transform of deploy. Still not working. And the errors messages are so poor. Seriously Microsoft? Is your transformation system even working? I see question similar to mine everywhere.
And now I get
The file is correct, transform works fine from Visual Studio Publish tool. I really think the xml transform tool from Microsoft in Azure is just not working.
EDIT 3
Is it possible to issues from my transformmations come from NLog because of the name and then special rule I apply on it?
When submitting an app and test assembly to Xamarin Test Cloud using test-cloud.exe (version Xamarin.UITest.1.3.9.1500-dev) we also need to submit an App.config file (as our test assembly relies on configurable appSettings).
Initially I had hoped that everything within the bin directory (either Debug / Release depending on --assembly-dir provided) would be uploaded to Test Cloud.
This does not appear to be the case, my App.config file (XamarinMobileTests.dll.config) present in the bin directory is not uploaded.
So, to address this issue, I have attempted 2 potential solutions, none of which I have had any success with, these are as follows:
Using the --data parameter with the submit command (--data XamarinMobileTests\bin\Release\XamarinMobileTests.dll.config). This always seems to return an error: "Data files must be located in the assembly directory or a sub folder."
I have attempted to put this file in various locations, with no luck.
Specify appSetting values within the --test-params parameter. This executes the submit command without error and instantiates a test run in test cloud. However, the Xamarin.UiTest Sdk does not seem to have any support for accessing the --test-params specified. My only option seems to be using the Xamarin Web Api, figuring out the test run (also not available via the Sdk) and then fetching the test-params from the test run meta-data.
The documentation on their site is extremely limited for these parameters.
Has anyone experienced similar issues in the past or found a potential solution?
Ideally, the config file is uploaded by default. However, if this is not an option, then solution 1 would be my preferred choice.
Turns out the issue was with a trailing "\" on the --assembly-dir that was causing the config file specified in --data to not be uploaded.
Changing:
".\XamarinMobileTests\bin\Release\"
to:
".\XamarinMobileTests\bin\Release"
Resolved the issue and the config file was successfully uploaded.
It looks as if the test-cloud.exe does some flakey comparisons on file paths.
I am looking for a hopefully ready, out of the box solution for my problem here. Here is outline:
I would like to have a file named local.config that contains certain information about my local environment.
That file will be ignored and will never make its way to the build server (ignored from gitHub).
Whenever I build locally, transformation happen.
Whenever I build on the server, whatever information found in main app.config is used.
Both SlowCheeta and Configuration Transform should work for your needs.
Here is what I ended up doing and there is probably better ways to do what I was after but unfortunately (and the fault is on me for not formulating the question correctly).
Modify the cproj file with the following:
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
Place your config files and transforms into your project accordingly. Every time you build, the configuration is transformed just fine.
I did not like that fact I had to have an extra base.config file but apparently, transforming from source directly to the target makes the msbuild rather upset.
I'd like to use visual studio to store in source control xml files coming from a server.
I have a request like http://server/query.aspx?FILE_ID=1234 that allows me to download an xml file. Those file are part of our development activities, that's why I'm looking for a convenient way of integrating those file in source control.
I'd like to have a project containing all the xml files I want to check-in in source control and add a pre-build command allowing to download the files, but I did not find any convenient way of doing it.
People have a tendency to forgetting to do it manually, and we have already seen all the possible scenarios: lost files, released version without the ability to know the exact configuration used, ... I'd like to automated this step so that it does not happen again in the future.
I'm sure there is a simple and smart solution, but I could not find it. Any suggestion would be appreciated.
You should be able to use wget in a pre-build action to fetch the latest version of the files. I can't think of a reason why that wouldn't work.
Personally i would consider finding a way to automatically commit those files to source control whenever they change on the server. I've never used tfs, but I assume there is a commandline-client which allows you to commit files in a scripted way. If you don't have any control over when the files change you could do this every N minutes on a machine which is always on.
You can write a (powershell) script that does the fetching, and checkin of the file before your build starts. That's how we fetch external assemblies to be included in our build.
To get you started, take a look at these powershell functions for TFS interaction:
http://www.brokenwire.net/bw/Programming/73/ (TFS 2008)
Our code uses different settings for development and production environments so we were looking at using VS2010's web.config transform capabilities. After hours of trial and error, nothing has worked. We found a Web.config transformation tester and found that what we had been trying was supposed to work (according to this tool.)
We tried testing the transformations using Build, not Publish. Does it only run on Publish or could something else be wrong?
Yes, it only runs on Publish. To test, publish to a local dir. You'll want to publish your application with the correct target environment set.
You can also integrates web config transformations with MS Build.
It seems you don't have to be in Publish mode to generate a transformed Web.config file. There's just a bit more work involved.
Open the Visual Studio Command Prompt and navigate to your working project directory that contains your .csproj file. Enter the following command:
MSBuild project.csproj /t:TransformWebConfig /p:Configuration=Debug
The example above would run the Debug transformation during the build of project.csproj. This will output a Web.config file into the obj\Debug\TransformWebConfig\transformed\ directory, where Debug is whatever Configuration you set in the command above.
Copy this file to replace your root Web.config file, and you're done. You could write a batch script to run both of those items automatically, but for larger projects with many configurations it could become unwieldy.
You might be able to add those command line arguments to the build process inside of Visual Studio, but I'm not sure how - as far as I know for this method to work you would have to build from the command line instead of inside Visual Studio. You can still use Clean inside of Visual Studio to clean out the obj folder but it will only clean the solution configuration mode selected in the IDE. Clean will not revert your edited web.config file, so you may want to back it up before proceeding if you need to.
(Command line arguments found from this MSDN article.)
You don't need run Publish/Build Package in order to test Web.config transformation. There is a cool trick to quickly know the transformation result here. Scroll down until you see a comment about creating TransformConfig project. It works like a charm, note that you can safely ignore 7th step (frankly I don't know how to do that step properly but fortunately we don't need it :)).