Total Pageviews

Disclaimer

This is a personal web page. The views expressed on this blog are mine and do not necessarily reflect the views of my current employer.

I am currently employed by Morgan Stanley.

February 26, 2011

MoMA Limitations

To port a Windows/.NET application to Linux/Mono, you must have too many skills and a lot of patience. Though Mono team invent MoMA and keep improving it, there are still some areas MoMA cannot cover. These are the limitations you should pay special attention to. I found them during porting #SNMP to openSUSE/Mono.
First, if MoMA reports one assembly contains missing/TODO/not implemented APIs, you still have some possibility to use it on Linux/Mono without a problem. A typical example is Microsoft Unity. I use Unity in #SNMP, but the part of Unity #SNMP relies on seems to be working fine on Mono, although MoMA reports several issues.
Second, MoMA is not yet able to analyze some compatibility issues, such as the ones listed in this guideline page,
You must pay more attention to the guidelines, as this kind of issues are harder to identify and fix.
So "check out your source code on Linux, build it in MonoDevelop and run your application" can be a good start. A crash can indeed tell you more than all the written words, and reveal how uniqueness your application is.
Good luck.

If You Cannot Install/Uninstall IIS 7

IIS 7 (7.0 on Windows Vista and Windows Server 2008, or 7.5 on Windows 7 and Windows Server 2008 R2) installation depends on Windows CBS. This is a bless but also a curse. If you find installing or uninstalling IIS 7 failed with an error message, please blame CBS in most of the cases.

Then why may CBS ever be corrupt without any hint? Possible causes are listed below,
  1. You have run a "so called" registry optimization software. I believe the vendors neither fully test such products nor have a close enough relationship with Microsoft to learn about every registry keys. So stay away from them.
  2. You have hardened the box. In some firms (financial firms especially), such hardening is mandatory for every server boxes. However, if the process is not Microsoft certified and indeed some registry or permission is changed wrongly, you will end up with lots of problems including this IIS one.
  3. Windows Update process ended abnormally and broke CBS (like turning off Windows protection when Windows Update is in progress).
  4. Many others…
About how to resolve the issue, you might go on to read part II,
 

February 13, 2011

BigDipper Light: Knowledge Base Initialized

Just started to publish #SNMP articles in KB format, and hope I can publish more of them in the coming weeks,
Please feel free to suggest any topics that you may be interested in.

February 04, 2011

Don't Let Windows Forms Bite You

I just recently understand how heavily Windows Forms depends on native Windows components and why switching to WPF is nice for developers in some scenarios. So the story goes.
Do you know that if you use RichTextBox in your application .NET Framework automatically sets a dependency on riched20.dll? And for some reason such a dependency can be very harmful, and many people suffer.
When you append certain text into the box, riched20.dll may spend a surprisingly long time and one of your CPU cores to do its task and ignore your anger.
This may be acceptable on multi-core machines, but what if your machine has only one core?
:) So next time please use a simple TextBox instead (TextBox does not rely on riched20.dll), or switch to WPF/Silverlight.
Is there any other well-known Windows Forms issue like this one?

February 02, 2011

A Tip for SnmpSharpNet (SNMP#NET) Users

Well, I believe you have the habit of reading release notes and pay attention to what was written in SnmpSharpNet's one.
Then you should know that in almost all cases Dispose or using must be used for UdpTarget objects. However, many users ignored this tip and experienced socket problems (http://topic.csdn.net/u/20110114/15/7871705d-c71d-4e27-b01c-bf10fd108e07.html).
Luckily SharpSnmp (http://sharpsnmplib.codeplex.com) uses a different design which is free of such issues, so you can feel free to try it out.

Net-SNMP snmpd.exe Crash On Windows

Well, there are already posts on the Internet about this issue, that snmpd.exe crashes on Windows. I am using Windows Vista SP2 and I also notice this issue.
In Windows Event Log (Application category) it is too easy to locate the crash information,
(On a Chinese Windows Vista SP2 machine)
错误应用程序 snmpd.exe,版本 0.0.0.0,时间戳 0x4abf748e,错误模块 unknown,版本 0.0.0.0,时间戳 0x00000000,异常代码 0xc0000005,错误偏移量 0x00000000, 进程 ID 0x1a14,应用程序启动时间 0x01cbc2a468461494。
0xc0000005 means access violation, but it cannot tell you what is the root cause.
I was planning to troubleshoot it further, but suddenly I found this paragraph on OpenSSL site, http://www.slproweb.com/products/Win32OpenSSL.html
About OpenSSL 1.0.0: Today (May 4, 2010), the 1.0.0 builds are released. Finally. Developers can begin testing against it. Users should still consider this beta - if your SSL-enabled software works for you under 1.0.0, then great, if not, downgrade to 0.9.8n. We are now in a transitionary phase to the 1.0.0 series. Developers: In order to keep things simpler, 0.9.8n will be removed in a few months - upgrade ASAP. For most software, upgrading won't be an issue.
Therefore, I tried to uninstall OpenSSL 1.0.0c and install 0.9.8q instead.
Guess what? Yes, everything starts to work fine.
So if you plan to use Net-SNMP agent on Windows, remember that choosing a proper version of OpenSSL is what you should consider.
BTW, I have fired a bug report to OpenSSL guys, and hope they can find out a solution.