Thursday, June 25, 2009

Azure Cloud over firewall: HTTP protocol incompatibility

Hello there,

Just got a real problem - out corporative Squid firewall does not support HTTP 1.1 properly, and Azure data storage strictly requires it.
As a result, accessing Azure data from local application is not possible at all.
For example, log viewer application are useless.

And of course it is really hard to kick our administrators to change it.

Tuesday, June 23, 2009

Issue with parsing command lines containing path in c#

Hi!
Another strange detail of .NET/C#:
I needed to pass two pathes to c# command line arguments, and wasn't able to control whether they are ended with backslash or not. Really it was a C# post-build tool so arguments were passed by MsBuild. Final command line looked like following:
"C:\My Path\My Program.exe" "C:\First Path\" "C:\Second Path\"
However C# command-line parser treats \" as esacape sequence
so for this sample
args[0]=="C:\\First Path\" "
and args[1]=="C:\Second"
and even args[2]=="Path\"".
Absolutely unacceptable, isn't it?
The only way to solve it I can see is to get the whole original command line from Environment.CommandLine and have your own parser. Please remember that this value includes executable name as well that may be or may be not quoted too.

Some explanation is here:
http://www.eggheadcafe.com/conversation.aspx?messageid=31268633&threadid=31268617

Wednesday, June 03, 2009

Converting Word document to clean HTML

Just got a request to convert our User Manual from Word 2007 to nice HTML format. As you may know Word provides really ugly formatting when exporting to HTML. There is another option named "Filtered HTML" that provides much cleaner one but still not acceptable.
I tried different approached found from Google - exporting and cleaning by Tidy, manual replaces, even using Gmail preview function (send document to GMail account and use preview on site).
Still looks ugly. I did not try DreamWeaver funcion for Word HTMl cleaning yet, maybe found one to try.
If it didn't help - need to copy-paste without formatting and format manually :-(.

Really Format Manual seemed to be the only possible solution - did it finally in Expression Web I had at hand. Funny tool but still missing some important features like formatting copier.

Monday, June 01, 2009

Troubles accessing WCF service on Vista

Got this problem seconf time so need to describe it for future.
(Strange that there are so few comments on it found by Google.
Do any other developers use Vista? Or they know some secret way?
One of useful advises I met was "Get rid of Vista")

So, back to the problem.
I tried to debug by WCF service-based application on Vista
after succesfully running it on Windows XP.
However, it did not work.
First idea was to restart VisualStudio with Administrator permissions that is usual.
But it did not work again and gave smth. "is in Faulted state" error.

Magic words are the command:
netsh http add urlacl url=http://+:9001/ user=DOMAIN\user
Replace URL and user domain/name with your data.

More details are here:
http://stackoverflow.com/questions/598643/hosting-a-wcf-service-in-vista
and here
http://msdn.microsoft.com/en-us/library/ms733768.aspx

By the way, thanks a lot for all the guys from http://stackoverflow.com/. Great job!

(Sidenote. Why is it so complex to request permissions elevation from .NET? I got samples from Microsoft here but it is very unconmmon anyway)