Sign in
Junfeng Zhang's Windows Programming Notes
Win32, Fusion, CLR, .Net Framework, and others
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
RSS for posts
Atom
RSS for comments
OK
Search
Tags
.NetFramework
Debugging
Fusion
General
Others
Pages
Troubleshooting
Vista
Win32
Archive
Archives
May 2012
(1)
July 2009
(1)
May 2009
(1)
March 2009
(1)
February 2009
(1)
December 2008
(2)
November 2008
(1)
August 2008
(2)
July 2008
(2)
June 2008
(2)
April 2008
(4)
March 2008
(2)
February 2008
(4)
January 2008
(1)
November 2007
(3)
October 2007
(1)
September 2007
(1)
August 2007
(5)
July 2007
(9)
June 2007
(3)
April 2007
(2)
March 2007
(3)
February 2007
(1)
January 2007
(2)
December 2006
(2)
November 2006
(4)
October 2006
(6)
September 2006
(5)
August 2006
(8)
July 2006
(2)
May 2006
(2)
April 2006
(12)
March 2006
(9)
February 2006
(5)
January 2006
(2)
December 2005
(10)
November 2005
(7)
October 2005
(2)
September 2005
(3)
August 2005
(1)
July 2005
(6)
June 2005
(8)
May 2005
(17)
April 2005
(9)
March 2005
(6)
February 2005
(9)
December 2004
(7)
November 2004
(12)
October 2004
(16)
September 2004
(16)
August 2004
(15)
July 2004
(10)
May 2004
(6)
April 2004
(14)
March 2004
(19)
February 2004
(39)
January 2004
(6)
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Junfeng Zhang's Windows Programming Notes
How to get the assembly version and file version of your own assembly?
Posted
over 9 years ago
by
Junfeng Zhang
10
Comments
The question is, when your assembly is executing, how do you figure out the assembly version and file version of your own assembly? Your assembly (while executing) can be returned from System.Reflection.Assembly.GetExecutingAssembly(). So: Assembly...
Junfeng Zhang's Windows Programming Notes
AppDomain and Shadow Copy
Posted
over 9 years ago
by
Junfeng Zhang
15
Comments
.Net Framework has a feature called Shadow Copy . When shadow copy is enabled on an appdomain, assemblies loaded in that appdomain will be copied to a shadow copy cache directory, and will be used from there. This is great because the original file is...
Junfeng Zhang's Windows Programming Notes
Fusion binding log and fuslogvw.exe
Posted
over 9 years ago
by
Junfeng Zhang
12
Comments
Suzanne blogs again! This time, she is helping you on diagnose MissingMethodException . Of course, whatever she tries to help you, she can't live without fusion log. So what exactly is fusion log? Remember what fusion's role is in assembly binding...
Junfeng Zhang's Windows Programming Notes
jusched.exe
Posted
over 9 years ago
by
Junfeng Zhang
38
Comments
I really hate applications doing thing on my back. That is why I rename %ProgramFiles%\Common Files\Real\Update_OB\realsched.exe to realsched.exe.bak. And I just find out something called jusched.exe is running on my back. tlist shows it is from...
Junfeng Zhang's Windows Programming Notes
How to detect .Net framework installed or not.
Posted
over 9 years ago
by
Junfeng Zhang
13
Comments
This is another frequently asked question. If you search google how to detect .Net Framework , this( http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;315291 ) page ranks very high. Ignore all the details in the KB articles. It basically...
Junfeng Zhang's Windows Programming Notes
How to make an application as both GUI and Console application?
Posted
over 9 years ago
by
Junfeng Zhang
12
Comments
This is another common asked question. But it is a Win32 question. In Windows GUI applications and Console applications are very different. GUI applications have at least one window, and a message loop, but no standard in/out/error. Console applications...
Junfeng Zhang's Windows Programming Notes
How to get thread id for a managed thread?
Posted
over 9 years ago
by
Junfeng Zhang
10
Comments
This question comes up from time to time. The answer is, there is no explicit numeric thread id for managed thread today in .Net framework. Now if you do need a numeric thread id for whatever reason, you can use System.Threading.Thread.GetHashCode()....
Junfeng Zhang's Windows Programming Notes
Why recursive directory copy does not exist, and why it should not.
Posted
over 9 years ago
by
Junfeng Zhang
17
Comments
This question comes up in internal discussion from time to time. The reason is, the semantics of directory copy is not well defined. It largely depends on what you need. Here are some questions you need to answer before you go implement one: 1....
Junfeng Zhang's Windows Programming Notes
Console unicode output
Posted
over 9 years ago
by
Junfeng Zhang
4
Comments
Eric Lippert discussed how Windows Script Host output unicode in console for NT based OSes here . Of course, every console based applications have the same problem. This includes gacutil. In 1.0 and 1.1, gacutil translate everything to ANSI, then...
Junfeng Zhang's Windows Programming Notes
GetPrivateProfileString/WritePrivateProfileString
Posted
over 9 years ago
by
Junfeng Zhang
10
Comments
Learned a hard lesson. Contention between GetPrivateProfileString and WritePrivateProfileString may cause a deadlock, even for multiple processes. If you intent to Read/Write the same ini file, you have to lock the file yourself. Yes, I know they are...
Junfeng Zhang's Windows Programming Notes
Performance: One big assembly vs several small assemblies.
Posted
over 9 years ago
by
Junfeng Zhang
9
Comments
I frequently see people ask the same question in microsoft.public.dotnet.framework.clr and microsoft.public.dotnet.framework.performance. Which one has better performance, one big assembly or several small assemblies? Strictly from a performance point...
Junfeng Zhang's Windows Programming Notes
How is lock keyword of C# implemented?
Posted
over 9 years ago
by
Junfeng Zhang
5
Comments
This question is asked in an internal discussion. And here is the answer from CLR team. From: Subject: RE: How is lock keyword of C# implemented? At the core, it’s typically one „lock cmpxchg“ instruction (for x86) for entry, and...
Junfeng Zhang's Windows Programming Notes
AppDomainSetup explained
Posted
over 9 years ago
by
Junfeng Zhang
2
Comments
AppDomainSetup is a properties bag. It stores various properties that affects binding decision in an appdomain, as well as other decision as well. MSDN documents each properties in AppDomainSetup. But there are a few properties that are not well explained...
Junfeng Zhang's Windows Programming Notes
File Not Found vs Network Path not found
Posted
over 9 years ago
by
Junfeng Zhang
1
Comments
So the other day I received an email from a colleague. He had an assembly load failure. And the fusion binding log looks like following: *** Assembly Binder Log Entry (2/10/2004 @ 5:41:08 PM) *** The operation failed. Bind result: hr = 0x80070035....
Junfeng Zhang's Windows Programming Notes
Longest Java Class Name
Posted
over 9 years ago
by
Junfeng Zhang
6
Comments
http://www.davidflanagan.com/blog/000017.html I wonder if someone has time to the same analysis on .Net framework. I bet it will be much longer:)
Junfeng Zhang's Windows Programming Notes
How to tell if some file is managed assembly or not?
Posted
over 9 years ago
by
Junfeng Zhang
5
Comments
Another commonly asked question. There are many ways to detect if a given file is a managed assembly or not. For example, in VS.Net 2002/2003, dumpbin has an option /clrheader. It will dump the CLR header for you if the file is a managed assembly....
Junfeng Zhang's Windows Programming Notes
FileVersion and GAC
Posted
over 9 years ago
by
Junfeng Zhang
5
Comments
Every assembly has an identity, which includes name, version, culture, and public key/token. Also every binary in Windows can have a file version. The file version is orthogonal to assembly version, and there is no co-relation at all. You can change them...
Junfeng Zhang's Windows Programming Notes
How "safe" (from a best practice and supportability perspective) is the use of DLL injection techniques?
Posted
over 9 years ago
by
Junfeng Zhang
4
Comments
Another question in internal discussion. Here is one reply: From: Subject: RE: DLL Injection DLL injection is never safe. You're talking about squirting code into a process that was never designed, built, or tested by the process...
Junfeng Zhang's Windows Programming Notes
CLR Profiler, Office 2003, WPS Office 2003, and Open Office 1.1
Posted
over 9 years ago
by
Junfeng Zhang
2
Comments
So I was playing CLR Profiler lately. It comes with a very good document written in word. It is really a simple document with text, and a lot snapshots. The document is about 11M. When I finished reading the document, I noticed my machine kind of slows...
Junfeng Zhang's Windows Programming Notes
Assembly listing Tool
Posted
over 9 years ago
by
Junfeng Zhang
2
Comments
So my submission in gotdotnet.com sample finally gets approved. Here is the link to download it. http://www.gotdotnet.com/Community/Resources/Default.aspx?AFXPath=/Resource[@ResourceId='F0CECD72-7287-4891-8D5E-5763AD14C2FD'] ] This is a tool to...
Junfeng Zhang's Windows Programming Notes
Very long assembly name
Posted
over 9 years ago
by
Junfeng Zhang
9
Comments
Speaking of file name inspired me to write another post about assembly name. Windows supports long file path since Win95 time. It has a MAX_PATH limit, which is defined as 260. Prior to .Net era, you seldom see long file name. If you poke around...
Junfeng Zhang's Windows Programming Notes
Where is .Net framework installed?
Posted
over 9 years ago
by
Junfeng Zhang
2
Comments
This is another often-asked question. As of today, there is no managed answer. mscoree!GetCORSystemDirectory returns the directory of where .Net framework is installed. It is documented here ( http://msdn.microsoft.com/library/default.asp?url=/library...
Junfeng Zhang's Windows Programming Notes
How to tell if an assembly is delay signed or not.
Posted
over 9 years ago
by
Junfeng Zhang
1
Comments
.Net framework has a great feature called delay signing. Every strongly named assembly has a public key, and a strong name hash stored in the metadata. At runtime CLR uses the public key to verify the strong name hash to make sure the assembly is not...
Junfeng Zhang's Windows Programming Notes
Cost of calling unmanaged code from managed C++
Posted
over 9 years ago
by
Junfeng Zhang
5
Comments
Question and answers about cost of calling unmanaged code from managed C++. From: Subject: RE: Cost of calling unmanaged code from managed C++ The biggest difference in performance is the cost of parameter marshalling. With C++ because...
Junfeng Zhang's Windows Programming Notes
How to detect .Net Framework installed in a web client?
Posted
over 9 years ago
by
Junfeng Zhang
3
Comments
In my last post I talked about how to detect .Net framework installed in your local machine. This is another .Net framework detection. But not for you, it is for web servers. Suppose you browse some web site. How does that web site know if you have installed...
Page 1 of 2 (39 items)
1
2