Authentication doesn't set in iis for web application if try to assign it with parameter

Aug 7, 2015 at 12:52 PM
Edited Aug 7, 2015 at 12:53 PM
in my installer i have:




WebDirProperties = new WebDirProperties(serviceName)
                        {
                            AttributesDefinition ="[AUTHDEFINITION]" 
// "AnonymousAccess=yes; WindowsAuthentication=no"
                        },

This authentication type is defined by user in ui and i check that this parameter is really set into "AnonymousAccess=yes; WindowsAuthentication=no"
But it doesn't actually set authentication as requested (but derived it from parent web site)! If i hard code this value it set it correctly! What can be the problem and how it could be resolved?
Coordinator
Aug 7, 2015 at 1:13 PM
Check your WXS and you will see that your [AUTHDEFINITION] is not embedded in it. You cannot set AttributeDefinition to the WIX proiperty as WiX has no idea about "AttributesDefinition".

Most likely you want to bind WiX attributes individually to the formatted properties.
AttributesDefinition = "AnonymousAccess=[AUTHACESS]; WindowsAuthentication=[WINAUTH]" 
However I am not even sure WiX allows binding these attributes to properties. Most likely it requires them to be hard coded.

I just checked quickly and no you cannot set them dynamically they have to be hard coded to 'yes' or 'no'. This is what you should check if you are trying to adjust WiX attributes directly: http://wixtoolset.org/documentation/manual/v3/xsd/iis/webdirproperties.html.
Aug 7, 2015 at 3:26 PM
how do you know that it can't be set dynamically?
Coordinator
Aug 8, 2015 at 1:27 AM
It's not necessarily obvious. The WiX/MSI documentation almost never reflects it directly but usually YesNoValues cannot by bound to the MSI properties.

Saying that you should not take my word for this and do the testing and see if binding is possible.