How fast is a .NET application compared to C/C++?
Many C#/VB.NET
applications will run 10-30% slower than their unmanaged counterparts. The main performance hit in managed applications
comes from a need to load the .NET runtime and then compile the application on the fly before actually running it. Currently it is not
uncommon to wait up to 30 seconds for an ASP.NET page to load on 1.6Ghz
512MB Dell with 500 Mhz Rambus memory. Additional performance penalty occurs
when ActiveX and COM components are accessed from .NET. Due to the complex marshalling protocol, it may take up to 80 CPU cycles to execute a function from an
unmanaged component. As developers learn .NET optimization tricks and JIT compiler optimization becomes more efficient, performance of .NET applications will become
comparable to C++.
Should we move our VC++ 6.0 application to VC++ 7.0/7.1/8.0?
The VC++ 2005 is the latest version of Microsoft's VC++ compiler. It has a
slue of Windows compatibility features not available with older compilers.
As a rule of thumb, I recommend migrating to a new compiler within a year of
it's appearance.
Where can we find a Web Service that performs a specific task?
Can I host a .NET web service on Windows NT or Windows XP Home?
No, ASP.NET web services require IIS5 and up.
Can I expose multiple classes as a .NET web service?
No, only a single class can be exposed with [WebMethod] attributes.
How does MSIL compare to Java byte code? There are some technical differences between MSIL and Java byte code. This, however, should not obscure the fact that
C# is closely related to Java; from syntax to the class library.
What is the difference between BaseStream class and NetworkStream
class?
BaseStream is mainly used to work with files that have a fixed length. It, therefore, supports such methods as Peek() and Length.
NetworkStream is used to manage network stream and has no way of saying what the size of the stream is. You will need to use timeouts to decide
when an application needs to stop reading data from the NetworkStream.
What should I know about TCP/IP programming with .NET?
1. Incoming and outgoing messages are stored in different
buffers- there is no chance for data corruption when you
receive and send data simultaneously.
2. It has been reported that TcpClient.Close() method has
a possible bug. When this method is called the garbage
collector may actually dispose off TcpClient instance.
3. Depending on the network conditions, the receiving
buffer may contain several messages. It is not possible
to guarantee that only a single message or fraction
whereof arrives at a time.
How can I use C++ in ASP.NET?
You can create COM or .NET components with C++ or MC++ and call them from ASP.NET. You can also write your
own CodeDOM compiler for a subset of C++. The later should keep you busy for a number of months.
How do I view SOAP messages being sent to my IIS server?
You can view very limited information about your SOAP requests in IIS log files.
For debugging purposes, get a good tcp tool to monitor all traffic to and from the web server. I use
MS Soap Toolkit, HttpInspector and TcpSpy.
How do I use C++ header files in C# or VB.NET? Header files are not supported in either language.
How do I expose a COM component as a Web Service?
Simply add a reference to the component in your VS.NET project. A COM wrapper will be
auto generated. You can even use IneliSense to discover what
methods are supported by the component.
What is the difference between DataGrid control in Windows Forms and Web
Forms? Windows Forms controls have more functionality than Web Forms. Also,
DataGrid in Web Forms has to be bound to the form before it displays any
data.
Why is ADO.NET serialization slower than ADO?
ADO uses binary serialization while ADO.NET uses text based serialization. Since the text takes more space, it takes longer to write it out.
Can I dynamically generate an HTML page that contains images not stored on
the hard drive?
Yes, you can. On page load event you will inspect client request. If it is a page, you will
dynamically generate an HTML page. If it is a gif
contained in the page, you will generate the gif.
Does adding more references to my project increase the size of
executable?
References are loaded as needed when the application is run. If a reference is not used, it will never be loaded.
How do I send large amounts of data with a Web Service?
It is best to compress the data before sending it. Base64 encoding provides
good results.
How do I display HTML in .NET?
Add a reference to COM Web Browser control.
Is .NET framework SDK backward compatible?
Gold is not compatible with RC, RC is not compatible with beta2, beta1 is not compatible with PDC.
This indicates that users will end up with multiple versions of the .NET framework installed side by side to support different .NET applications.
How do I take screenshots with .NET? Use Pinvoke to call win32 api
keybd_event
Why do WebRequest and WebResponse occasionally blow up when making
calls to an ISAPI dll? This is an unconfirmed bug that is fixed by using
unmanaged wininet library instead of .NET HTTP library.
How do I overload and use an overloaded operator?
struct Complex
{
//public x,y;
public double x,y;
public static Complex operator+(Complex a, Complex b)
{
Complex c;
c.x=a.x+b.x;
c.y=a.y+b.y;
return c;
}
}
class Test{
public static void Main()
{
Complex z1,z2;
z1.x=1;
z1.y=3;
z2.x=0;
z2.y=10;
Console.WriteLine(" x component is: "+(z1+z2).x+" y component is:
"+(z1+z2).y);
}}