I have just added a forum for the ModelConverterX tool to the [FsDeveloper] site. Please also check the post where I explained the ideas behind this tool and what you can expect in the first alpha release. And if you don’t mind I’ll go back to the coding now, so that this alpha release will be there soon.
It”s well known that the C# compiler is the csc.exe and that you can find it on the installation folder of the .NET platform. What i”ve seen in these last days (specially since i”ve started my in-depth study of the C# language and have started discussing it with some collegues and friends) is that many people use the C# compiler and really don”t know what it does or what are the available options you can use when you compile a C# app.
For instance, i was astonished with the number of people who don”t know what the following line does:
csc /target:exe /reference:mscorlib.dll /out:HelloWorld.exe HelloWorld.cs
Even among those that know what it does (btw, it”s compiling the HelloWorld.cs file into an exe called HelloWorld.exe and saying that it needs the “all mighty” mscordlib.dll to do that), many don”t really understand why you can reduce it simply to this (besides saying that it”s magical):
So i thought I should write something about this (even though that i”m positive that there”s already lots and lots of info out there). Ok, so why do the previous 2 instructions produce similar results? Easy:
- by default, the csc.exe will always generate an executable. since i was trying to built an exe, then i can just remove the /target:exe from the command;
- mscorlib.dll is a special assembly since it contains several of the basic (or primitive) types that you use when you build a C# program. The C# compiler knows this and will always add a reference to this assembly. Notice that this might not be what you want (for instance, when you”re building a silverlight application, you need to compile your cs files agains Silverlight”s mscorlib.dll and not against the one that is installed with the full .NET version). In these scenarios, you can cancel the default behavior of the compiler by passing the /nostdlib parameter;
- since i wanted the assembly to have the same name as the file that i was compiling, then it”s safe to discard the /out parameter. When you do that (ie, when there”s no /out parameter), the compiler will name the final assembly with the name of the file that has the Main method (exe) or the name of the first cs file you”re compiling (dll).
Not too complicated, right? More dificult is understanding why you can compile an app that uses a type defined inside the System.Data.dll assembly without passing a reference to that assembly during compilation. well, it happens that the csc.exe can also receive a response file. A response file is simply a text file where you define a switch per line. For instance, if i wanted, i could transform my first example in a helloworld.rsp (notice the extension) file that would look like this:
You can make the compiler to use these settings by using the /@ switch:
csc @helloworld.rsp helloworld.cs
If you want, you can have several response files. One important thing: the C# compiler will always load any csc.rsp response files it finds. This means that you can simply rename the previous file to csc.rsp and the compiler will pick it up automatically, making the @ switch disposable(do keep in mind that in my example you really don”t need a response file since the parameters i”m passing are also automatically used by the compiler, as explained in the previous paragraphs).
Ok, interesting right? but still doesn”t answer my last question. It happens that the compiler currently searches for rsp files in two places: current working folder and the installation folder of the compiler. If you open that folder, then you”ll see that it has a csc.rsp file with references to several of the assemblies installed by the .NET (including the assembly i mentioned in the previous example). This file is special and is always picked up by the compiler. That”s why you can do what i was saying 2 or 3 paragraphs above…
One important gotcha: the csc.rsp file will always be loaded by the compiler. If you don”t want that, then pass the /noconfig switch to the C# compiler.
btw, do notice that you can add or remove assemblies, though i see no reason for removing any of the list. Some people think that by removing assemblies they”re improving the performance of the new compiled assembly. This is not true because the compiler is smart enough to only add references to types that are used in your C# code files.
Finally, another question that pops up quite frequently, is where do those assemblies come from? for instance, what happens when you have several versions of the .NET platform installed. To answer this, we must know the places where the C# compiler searches for the dll:
- working directory
- directory that contains the csc file (notice that inside this directory you”ll find copies of the dlls that exist on the GAC.)
- folders passed through the /lib switch
- folders defined on the LIB ambient variable
As always (or should i say, as amost always?) msdn has a good reference on the parameters you can pass to the compiler. Reading them garantees that you”re aware of all the options you can use when you compile your program. Don”t stop using VS (or another cool editor). However, do know what you”re doing!
I’m not sure how I feel about this; the fall out from the now infamous EOLAS patent dispute has had a fundamental effect on how we interact with the Web when using Internet Explorer, and I have never felt that the change was for the better. Heck, I never supported the patent in the first place(another MVP described it as a “hot button issue” for me in an email dialogue tonight).
Many will not remember this, but a few years ago there was a “developer preview” (my terminology, can’t remember exactly what they called it) that was released for a short while for testing that directly addressed the EOLAS patent – it was a horrid thing, and I’m so glad they didn’t go ahead with it. Basically, every single control on a web page that required user interaction triggered a dialogue box. I remember testing the changes at Java Boutique, sometimes triggering dozens of dialogue boxes per page.
Thankfully, the original version of the changes to Internet Explorer didn’t proceed, and we ended up with the discreet, “Click to activate and use this control” prompt. The prompt is becoming more rare nowadays, as web sites learn how to work around the changes.
The following shots show how Microsoft’s adaptations to address the EOLAS patent matured over the years. Here you see the very irritating dialogue box that popped up for every affected control, an older version of the mouseover text, and the final version. Sadly, I can’t remember when the change from “Press SPACEBAR or ENTER to activate and use this control” to “Click to activate and use this control” occurred – perhaps one of my readers will share their knowledge of that.
The entire EOLAS brouhaha has been a real roller coaster ride; EOLAS were originally awarded $521 million by jury in 2003 but that award was partially overturned on appeal – one of the facets of the appeal was should the jury have been allowed to consider whether EOLAS patent was/is invalid. The case was due back at court last month for a retrial, but was postponed.
In the midst of the lawsuit, in November 2003 the Deputy Patent Commissioner of the US Patent and TradeMark Office, Stephen G Kunin, ordered the agency’s examiners to reconsider the EOLAS patent that had been awarded to the University of California back in 1998. That had only happened 151 times in the last 22 years!!!
This led to the patent being invalidated in March 2004 in a preliminary ruling:
Then, in August 2004, Microsoft has another win, with the Patent Office reported as rejecting all 10 patent claims under review:
But then in 2005, the patent was upheld, although I do note that Microsoft do have permission to fight it out once again after it was issued with a patent covering the same concepts as the EOLAS patent - basically it’s a “who invented it first” fight - the hearing was scheduled for June this year; I haven’t found any evidence of a result, and that could take up to a year.
Then the cats was put right in the middle of the EOLAS pigeons. A recent US Supreme Court decision cast real doubt on the original award of $521 million when that Court ruled that Microsoft cannot be forced to pay for patent infringements that occur when copies of Windows are made and installed on computers abroad. Remember, the jury originally granted the University of California and Eolas US$1.47 for each of the 354 million copies of the Windows operating system that included the Internet Explorer browser between Nov. 17, 1998, when the patent was issued, and Sept. 30, 2001 - but that count of 354 million was *worldwide*. By reducing the scope of computers caught by patent infringement penalties, EOLAS were looking at a potential reduction in their award from US$521 million award to US$187 million – a massive drop in anyone’s language.
On August 2007 EOLAS Chief Operating Officer Mark C Swords released a letter to EOLAS shareholders advising that although he could not talk about the exact terms of the settlement, the Board of EOLAS were anticipating a dividend of between $60 and $72 per share, although I must point out that there has been no direct link drawn between the release of the dividend and the settlement with Microsoft in the letter from Mr Swords. There will be an informal meeting for EOLAS shareholders at 7.00pm on Tuesday 4 September 2007 at the Holiday Inn Select, 1801 Naper Boulevard, Naperville, Illinois, at which the “future business plans of EOLAS, its finances, and “such information regarding the settlement as [EOLAS] are permitted to disclose” will be discussed.
So, it all seems to be over – it has not only been a roller coaster ride, it has also been fascinating watching the US legal system and its events here, and the US Patents Office, and how activities there affected what was happening in the Courts.
In the end, EOLAS got their settlement and Internet Explorer users got the short end of the stick… have EOLAS gone after other those behind other web browsers in the same way as they went after Microsoft? Um, not as far as I know…
I wonder how long it will be now before we see these things here in Ireland and the UK. For now, I have to make do with my HTC Touch.
This isn”t really a technical post, so you might want to skip it if you”re too busy :,,)
As I”ve said, i”ve been spending some time looking at C# and how it produces code that runs on the CLR. One of the things that has always puzzled me is why C# is called C# Until now, I”ve heard one or two interesting theories. The first is old (at least, I recall having heard about it in the past): since C# is supposed to be a better C++, then some see the # symbol as being composed by four + symbols.
The second one says that # is really the number sign that is used for a musical sharp, implying that he current sound is half step above the other (which really means that C# would above the other languages).
Btw, I ”ve found both these theories presented on the C# professional book (chapter 1 is available online here).
And you? what do you think? have you heard any better explanation for its name?
“The court says, clearly and unambiguously, that anti-spyware vendors’ labeling judgments are completely protected by 47 USC 230(c)(2), a statute designed to protect online filtering judgments. In support of this conclusion, the court says that:
1) Kaspersky qualifies as an interactive computer service provider (specifically, as an access software provider)
2) The labeled software does not have to be actually “objectionable;” the vendor qualifies for protection so long as it subjectively considers the software objectionable.
3) There is no “good faith” standard in the statute for the vendor’s decision to consider software objectionable.”
Bronwyn has put out a call for members to join geekgirlsblog; I suppose I’d better put my name in the hat [;)]
I haven’t met Bronwyn – our respective home towns are many thousands of miles apart, and I don’t get to travel much nowadays – but those I know who have met her have nothing but good things to say. Hopefully one day our paths will cross.
Fiddlercap – designed to help the non-expert gather HTTP logs (great for helping to track down malware-adverts)
One of the biggest problems I face when tracking down malicious banner advertisements is gathering proof sufficient to convince a web site and/or advertising network that they have a problem. Sometimes I am unable to reproduce a reported hijack by a banner advertisement despite my best efforts. When my correspondent is inexperienced they can struggle to gather the required data for me to analyse and publicise.
Eric Lawrence of Microsoft has also seen the need for a product that will make it easy for the inexperienced to generate an HTTP or HTTPS log, so he has created a simpler version of Fiddler especially to address this need.
Called Fiddlercap, the product can be used to easily take a snapshot of HTTP traffic, which is then sent to a “debugging buddy” (that would be me) :o)
My only question is whether Fiddlercap and Fiddler can be installed side by side. I must ping Eric about that, see what I can find out.
You can download Fiddlercap here: http://www.fiddler2.com/fiddler/help/log.asp