These are for MVC's internal plumbing. One enables client validation by default (you used to have to explicitly enable this in code) and the other chooses what style of client validation to use -- MVC2 or MVC3 style. "true" means do the newer MVC3 style.
Thank you I didn't know that. However, the question and concern is that they are in the web.config and Azure does not use web.config for appSettings. What do I need to do to get these to work in Azure?
In effect a web role is just a virtualised Windows Server running IIS.
Therefore your web.config is still used by the ASP.NET web application running on it- you just can't change anything in here without redeploying the whole site.
If it's something that doesn't change at runtime / without you changing some code anyway, you can leave it in web.config and it'll be deployed along with all the content and DLLs as part of your site.
If it's something you want to be able to change without redeploying the Role you can use the RoleEnvironment.GetSetting() to pull configuration settings from your Role Settings. This is a combination of adding a setting to your ServiceDefinition file, defining
it's value in ServiceConfiguration and then calling RoleEnvironment.GetSetting() within your code to retrieve the current value.
claude.rober...
Member
1 Points
2 Posts
Existing MVC 3 application migrating to Azure
Jul 04, 2012 11:57 PM|LINK
I have these standard appSettings in web.config and I don't know how to migrate them over as I do not call them myself in code.
Do I just ignore these or...?BrockAllen
All-Star
27522 Points
4901 Posts
MVP
Re: Existing MVC 3 application migrating to Azure
Jul 05, 2012 01:25 AM|LINK
These are for MVC's internal plumbing. One enables client validation by default (you used to have to explicitly enable this in code) and the other chooses what style of client validation to use -- MVC2 or MVC3 style. "true" means do the newer MVC3 style.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
claude.rober...
Member
1 Points
2 Posts
Re: Existing MVC 3 application migrating to Azure
Jul 05, 2012 01:27 AM|LINK
Thank you I didn't know that. However, the question and concern is that they are in the web.config and Azure does not use web.config for appSettings. What do I need to do to get these to work in Azure?
mattquinnuk
Member
18 Points
4 Posts
Re: Existing MVC 3 application migrating to Azure
Jul 06, 2012 12:22 PM|LINK
Azure does support web.config.
In effect a web role is just a virtualised Windows Server running IIS.
Therefore your web.config is still used by the ASP.NET web application running on it- you just can't change anything in here without redeploying the whole site.
If it's something that doesn't change at runtime / without you changing some code anyway, you can leave it in web.config and it'll be deployed along with all the content and DLLs as part of your site.
If it's something you want to be able to change without redeploying the Role you can use the RoleEnvironment.GetSetting() to pull configuration settings from your Role Settings. This is a combination of adding a setting to your ServiceDefinition file, defining it's value in ServiceConfiguration and then calling RoleEnvironment.GetSetting() within your code to retrieve the current value.