Windows Azure having troubles with date format - azure

I'm having a lot of trouble deploying a website on windows azure... with dates and money formats, for example. My question is: It is possible to change the server's culture, or do I have to change my entire app to fits the azure location settings?
Works fine on servers with Latin American standards.

You can add something like this to your web.config (in the system.web section):
<globalization uiCulture="en" culture="en-GB" />
You can find the appropriate identifier in the CultureInfo Class.

I believe you'll need to change the culture settings in your application. Here's a similar thread - Currency settings in Azure

Related

Is there an RoleInstanceId equivilent on Azure Websites?

I'm looking for the equivalent of an Azure RoleInstanceId, but on an Azure Website (as opposed to an Azure Web Role). I've looked extensively for such a thing, but to no avail. I even deployed a "test" website to display all of the Environment Variables on the Azure Website, but there didn't appear to be a useful variable in the set.
Any help in this regard would be greatly appreciated!
BTW, in case you're interested in why I would want such a thing, I'm trying to implement an advanced version of the Steve Marx's excellent Scalable Counters with Windows Azure...
Request.ServerVariables[ "INSTANCE_ID" ]
Get IIS site id from a website
Would give you IIS site Id .. Might work as an identify. Other than hard coding in configuration file.
That should give you a unique id then of inputting a id for each row of the counter.
Worst case would be just use Guid and generate it each time.
This would then make sure you counter would be good.
Hths,
James

How to generate a report of IIS settings for easy perusal?

I'm looking for a way to (hopefully) create a text file which lists all the settings in IIS for..
Virtual Directories
Web sites
Which framework is used on a certain website/directory
directory of hosted files
etc.
Basically I want to do some investigation on some of our servers to figure out where certain projects are located, without digging through right clicking and looking for the directory name manually, etc, for every domain we host.
The reasoning is that I often need to find access to files/projects I haven't worked on before, but historically, we don't have a strong naming scheme, so you can't just look where something "logically" would be - so, generating a list would be very helpful.
Something like this would be awesome, but I'm looking for any tips at all
Domainname1.com
framework: ASP.NET 1.1
directory: c:\inetpub\wwwroot\domainname1.com
Applications hosted at this domain:
etc, etc.
Plain text, XLS, XML.. anything other than right clicking through the whole list!
Thanks!
The IIS metabase is a configuration file that contains most of the settings of IIS, including what websites/application pools are running on the server. It's located by default at:
%windir%/system32/inetsrv/metabase.xml
You can potentially use that as a starting point and write a custom parser, or an XSLT transformation to get the report you want, but it's probably not going to be a trivial task.

Change Default Locale in IIS 6.0

I've got a hosted VPS hosted by a UK hosting company that for some reason is set to US settings. In fact, until recently, the regional settings were 'English - United States'. I've corrected the regional settings, but my application is still working with the wrong date format. See:
http://www.albaassoc.com/events/listevents.aspx
The default dates are supposed to be the current date to the date + 3 months, but as you can see, the dd and MM fields are swapped. Note: the AJAX calendar extender is manually set to dd/MM/yyyy so that is why the calendar pop thinks we are interested in June/July rather than January!
I know there are various ways to set a page or an application to use a particular locale, but I'd rather go for a global approach.
Is it possible to re-configure IIS to work in a different locale, or if not, can I tweak machine.config so that it is a once-only change?
I've got a ticket open with the host but I'm not going to hold my breath - they aren't going to want to reinstall IIS...
Thanks in advance.
Via the globalization element, you can set the culture and uiculture for a site (via web.config) or the entire machine (via machine.config).
I just got a similar issue (Windows Server 2008, IIS 7). I was able to fix it by editing the web config file, but like you I wanted a global fix.
The solution is in the config panel, regional settings. I don't know for you (what's your OS), but under WS2008, there is an administrative tab under regional settings. It allows you to copy the settings of your logged in user (you) to the administrative accounts (network services in this case). Rebooted and got it right.
The problem is often that the user running either IIS or the application pool your app belongs to is a system account which was created when the server was installed. They therefore inherited whatever the default locale was at the time.
If you can't fix it in regional and language options you can always try editing in the registry directly (with the usual proviso that messing around with the registry can seriously muck up Windows). The regional settings are all under HKEY_USERS\{userid}\Control Panel\International - if you compare what's there for each user with what you have under HKEY_CURRENT_USER\Control Panel\International it should be fairly obvious what to change. I've done this a few times on Windows 2000 servers and it's worked OK.
The other option is just to create a new user on the machine with the correct locale and then set both IIS and the application pool to run with that identity.
Bit of an old thread, but I still look after some legacy Classic ASP sites written by the now defunct Aztec civilisation in praise of their feathered gods.
A server move prevented all the date code from working and sacrificing a chicken was no help, so here is the very easy solution in IIS 7 that has not been mentioned, possibly because no-one else is suffering like me.
Go to IIS Manager.
Select either the root server node to apply to all sites, or select the site node you are having problems with if you want to leave the server default alone.
In IIS section, double click ASP icon.
Set Locale ID to your desired locale (2057 for UK).
This should take effect immediately.
Alternatively you could go buy a DeLorean, go back in time and kill the programmer who decided FormateDateTime(d, vbLongDate) was the best way of generating a date to be used in the database. Or persuade the client to give me a lot of money to replace the whole thing. Either's good.
I had a problem, with having the the date formatted mm/dd/yyyy when I wanted it to be dd/mm/yyyy.
I am using windows server 2003 and IIS 6
The solution was to add the following to any web config file, then reboot your server and it should work just fine.
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-GB" />

How to configure IIS7 to allow zip file uploads using classic asp?

I recently installed Windows 2008 Server to replace a crashed hard drive on a web server with a variety of web pages including several classic ASP applications. One of these makes extensive use of file uploads using a com tool that has worked for several years.
More information:
My users did not provide good information in that very small zips (65K) work once I tested it myself, but larger ones do not. I did not test for the cut-off, but 365K fails. And it is not only zip files after all. A 700K doc file failed also. ErrorCode 800a0035.
Soneone named Anthony Jones in microsoft.public.inetserver.asp.general provided the answer as follows:
In IIS7 IIS manager click in the web
site and double click the ASP icon in
the features view. Expand Limits
Properties and modify the Maximum
Requesting Entity Body Limit.
To which I replied:
That did the trick. And it was so easy. You have no idea how many things I tried that did not work.
I think there may be a second part though. One of the things I had done was to change the
setting in applicationhost.config from:
<sectionGroup name="system.webServer">
<section name="asp" overrideModeDefault="Deny" />
to
<section name="asp" overrideModeDefault="Allow" />
After I made your change and tested it, I changed the above to Deny just on general principals of not fixing what was not broken. The website immediately stopped working until I changed it back to Allow.
There is a size limit that you will probably need to set - what's the 500 error?

How to change SharePoint extended web application's web.config file

Using the SharePoint API, how can I modify an extended webapp web.config file?
I have to do some changes in this file to specify the connection string, membershipprovider, etc... for using Forms Authentication.
Currently, I can change the "master" webapplication web.config file, but not the extended one.
Edited
I'm using Sp 2007. I'm already using SPWebConfigModification class to modify the parent webapp. Thoses modifications are propagated to the extended webapp. I have to change ONLY the extended one. But I don't find the way to do it.
What I'm trying to achieve, is to program a little wizard that:
Shows a WebApp list so the user can select one
Extend that selected webapp to a different zone
Configure that extended zone to use Forms Authentication
Thanks
I got an answer form a blog.
In your case , you need to write a Web Application scoped feature which after you provision your site using your C# app, it is deployed to the newly-provisioned site and in the receiver of the feature you inject the required web.config settings because in that context configuration API is obtainable , but again bear the following in mind:
If you don’t use SPWebConfigModification class and either use ASP.NET 2.0 configuration API or your own mechanism , propagating changes across the farm is YOUR RESPONSIBILITY. If this happens on an standalone installation then you don;t need to be worried about this.
So it cannot be done externally. We have to do a feature in order to acheve this.
Thanks
Quick answer: look into the SPWebConfigModification class. I am assuming you're using SharePoint 2007. The best way to learn about this is to dig into open source projects:
Google code search: http://www.google.com/codesearch?q=spwebconfigmodification&hl=en&btnG=Search+Code
This project on CodePlex looks like it's one big SPWebConfigModification: http://www.codeplex.com/ajaxifymoss/Release/ProjectReleases.aspx?ReleaseId=13360

Resources