Tuesday, October 14, 2008

What is the equivalent to regsvr32 and regsvr32 /u a file in .NET development?

Try using RegAsm.exe. The general syntax would be: RegAsm. A good description of RegAsm and its associated switches is located in the .NET SDK docs. Just search on "Assembly Registration Tool". Explain ACID rule of thumb for transactions.

Transaction must be Atomic (it is one unit of work and does not dependent on previous and following transactions), Consistent (data is either committed or roll back, no in-between case where something has been updated and something hasnot), Isolated (no transaction sees the intermediate results of the current transaction), Durable (the values persist if the data had been committed even if the system crashes right after).


Where is the output of TextWriterTraceListener redirected?

To the Console or a text file depending on the parameter passed to the constructor.


How do I create a multilanguage, single-file assembly?

This is currently not supported by Visual Studio .NET.


Why cannot you specify the accessibility modifier for methods inside the interface?

They all must be public. Therefore, to prevent you from getting the false impression that you have any freedom of choice, you are not allowed to specify any accessibility, it is public by default.


Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?

There is no way to restrict to a namespace. Namespaces are never units of protection. But if you're using assemblies, you can use the 'internal' access modifier to restrict access to only within the assembly.

Why do I get a syntax error when trying to declare a variable called checked?

The word checked is a keyword in C#.

Why are there five tracing levels in System.Diagnostics.TraceSwitcher?

The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities.

What is the syntax for calling an overloaded constructor within a constructor (this() and constructorname() does not compile)?

The syntax for calling another constructor is as follows:

class B{

B(int i)

{ }

}

class C : B{

C() : base(5) // call base constructor B(5)

{ }

C(int i) : this() // call C()

{ }

public static void Main() {}

}

0 comments: