Jun 20, 2007
These guidelines are intended to help class library designers understand the trade-offs between different solutions. There might be situations where good library design requires that you violate these design guidelines. Such cases should be rare, and it is important that you provide a solid justification for your decision. The section provides naming and usage guidelines for types in the .NET Framework as well as guidelines for implementing common design patterns.
Read more: I have delicious Design Guidelines for Class Library Developers.
In the static readonly case, the containing class is allowed to modify it only
· in the variable declaration (through a variable initializer)
· in the static constructor (instance constructors, if it's not static)
static readonly is typically used if the type of the field is not allowed in a constdeclaration, or when the value is not known at compile time.
Instance readonly fields are also allowed.
Remember that for reference types, in both cases (static and instance) the readonly modifier only prevents you from assigning a new reference to the field. It specifically does not make immutable the object pointed to by the reference.
public static readonly Test test = new Test();
static void Main(string args)
test.Name = "Program";
test = new Test(); // Error: A static readonly field cannot be assigned to (except in a static constructor or a variable initializer)
public string Name;
On the other hand, if Test were a value type, then assignment to test.Name would be an error.
Jun 14, 2007
This is post for developers who are using xml comments.
The .NET Framework allowed C# developers to use XML-style comments in their code. This feature was added to VB.NET with version 2.0. The compiler can use these comments to generate basic technical documentation. The end result of using the XML commenting feature is a large XML file that is less than user friendly
How to get Sandcastle
The latest version of Sandcastle is available via href="http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE-A715-696E3A4873B2&displaylang=en">Microsoft's
March 2007 Community Technology Preview. You may install and run it on
Windows Server 2003 or Windows XP Service Pack 2. It requires the href="http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx
Framework 2.0, as well as the href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp">HTML
Help Workshop. Once the prerequisite software is installed, you can install
the Sandcastle tool.
I also have delicious Create .NET documentation with Microsoft's Sandcastle .
While working with Full-Text search, I come to situation where I have to write script which creates the catalog, enable it and start population on it.
Then I found there are stored procedures in master database only, which can usefull to craete, enable and populate the Full-Text Catalog in SQL Server.
Have a look at Implement full text search using Stored procedures.
Look at Help With Full-Text Catalogs - Stored Procedures are available too.
Jun 11, 2007
Jun 9, 2007
types: (not shown) Defines data types used by the service's messages.
message: Defines the data transferred by a web service operation, typically the name and data type of input parameters and return values.
port type: Defines one or more operations provided by the web service.
operation: Defines an operation that can be remotely invoked.
input: Specifies an input parameter to the operation using a previously defined message.
output: Specifies the return values from the operation using a previously defined message.
fault: (not shown) Optionally specifies an error message returned from the operation.
binding: Specifies the protocol used to access a web service including SOAP, HTTP GET and POST, and MIME.
service: Defines a group of related operations.
port: Defines an operation and its associated inputs and outputs.
From the computer where FogBugz is running, open a command prompt (choose Start, Run, type cmd, and click OK).
telnet smtpserver 25
If you get a message that says something like Connect Failed, the SMTP server in question is not accepting any connections. This may be because:
the SMTP server is not running
the SMTP server is configured to reject email connections from the FogBugz machine
If all is well, you will see a message that starts with the number 220 followed by a greeting.
You should see a message starting with the number 250 followed by something glib like "pleased to meet you"
Using the email address configured as "Notification Return Address" in the FogBugz Site configuration screen, type
You should see a message starting with the number 250 followed by something like Sender ok.
Using the email address you want to send a notification to, type
You should see a message starting with the number 250 followed by something like Recipient ok.
If you see a message that says something like "Relay Access Denied" -- this means that the SMTP server is configured to refuse any email that is not intended for its own domain. For example if you are sending mail to email@example.com using an SMTP server at mycompany.com and you see a message about relaying denied, this SMTP server probably thinks you are a spammer. You will need to find an SMTP server that is configured to accept email from the FogBugz machine to its recipients.
You should see a message starting with the number 354 followed by instructions to enter the email message..
Note that the last line contains a period (dot) alone. This signals that you are done typing the message.
You should see a message starting with the number 250 followed by something like Message Accepted for Delivery.
Check that the email was received. If it was not received even though the message was accepted for delivery, there is something wrong with the SMTP mail server.
Jun 1, 2007
I found solution for the following error:
Cannot convert null to 'int' because it is a value type
when i wrote
int i = null
Now we can assign null values to such value types viz. int, datetime, float...
Check out Nullable Types