Custom msbuild property
I am wondering if there's a way to add a custom property to msbuild through the UI?
Since I haven't seen a way, I have also tried using a build script by copying the msbuild command from the console and adding the property, but that seems to fail as well...
msbuild ".\MyProj.sln" /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:DeployOnBuild=True /p:PublishProfile=appveyor /p:MyProp=true
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 13 Feb, 2015 05:21 PM
MsBuild properties could be specified in environment variables. Just try setting
MyProp
environment variable.2 Posted by chris on 23 Jun, 2015 10:04 PM
I'm looking to do something similar.
@feodor can you explain how that would work specifically. If I wanted to add
/p:_DestinationType=AzureWebSite
as an option to my msbuild, how could I do that through environment variables?Support Staff 3 Posted by Feodor Fitsner on 23 Jun, 2015 10:08 PM
Just add
_DestinationType
variable on Environment tab of project settings (or setup it inappveyor.yml
).4 Posted by chris on 24 Jun, 2015 03:37 PM
thanks @feodor. I did add that environment variable to the Environment tab on the build settings, but I did not see it added when msbuild was called. This is the entry from my log
msbuild "src/MyProject.csproj" /m /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:DeployOnBuild=True /p:PublishProfile=appveyor
Support Staff 5 Posted by Feodor Fitsner on 24 Jun, 2015 05:11 PM
Right, it shouldn't be added to the command line, but any environment variable can be referenced in build file (.proj, .targets) as
$(variable_name)
, so if you have$(_DestinationType)
somewhere in MSBuild project and define environment variable with the same name that should work.6 Posted by chris on 24 Jun, 2015 06:03 PM
Got it! thank you.
Would you consider adding the ability to pass additional command switches to the msbuild.exe from the interface and yaml? Today we have Configuration, Platform, and Project file...But I would propose adding a 4th text box called Options || Command Line Params which would support custom command switches. This is typical in other CI servers like Bamboo and TeamCity and would love to see that here as well. Thanks again.
Support Staff 7 Posted by Feodor Fitsner on 24 Jun, 2015 06:18 PM
Sure, though you can always switch to a custom msbuild command.
8 Posted by chris on 24 Jun, 2015 07:03 PM
That's exactly what I'll do for now, thank you.
The main advantage I see to what i'm proposing though is leveraging the ease of configuration and the automatic packaging options. Once I go to command line, all of that is on me. That's certainly a fine work around, but it definitely takes away from simplicity you have here....which so many other CI servers are missing.
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:57 AM.