Questions and suggestions


I set the comment limit to 90 days. As a result, the original post for questions and suggestions has expired. This one is just to re-enable that.


Please post any questions or suggestions in this blog.


Questions and suggestions should related to Fusion and CLR Loader.


For example:


Things in Fusion/CLR that you don’t understand, or you feel confusing and requires more detailed explanation.
Things that you feel awkward in the current implementation and you want to see a change in the future.
etc.


Remember, I don’t do diagnose. Use newsgroup, MSDN forum, PSS for that.


Thanks for reading.

Comments (12)

  1. David Levine says:

    Hi Junfeng,

    It’s good to see so many posts from you…

    Couple of ideas that would help me work with fusion and the loader.

    First, thanks for including the load context in the fusion log output – that helps a lot. Context-related info is helpful – output more if you have it.

    The tool fuslgvw should ship with the runtime so that as problems come up on customer machines we have a tool available we can use to get instant info about loading issues. It needs to be preinstalled on the machine in case there is no network connectivity. I’ve been unable to find this when looking at non-development macbines with fusion-related problems.

    There should be a tool (perhaps put this in fuslogvw) that handles the setting of registry values that affect fusion, especially as it relates to logging and diagnostic info. There a registry setting to force fusion to log to a file – how do we set the filename? Or where is the log file?

    Basically, we need more knobs we can tweak and an easy way to tweak them.

    When an exception is thrown fusion should distinguish between an inability to find a file versus an inability to load a file. I believe the exception message says that it can’t find or can’t load the file…which is it?

    A minor but annoying thing: please redo the fuslog UI so that the main screen is adjustable in size.

    Thanks.

    Dave

  2. David,

    Thanks for stopping by.

    You don’t need to use fuslogvw.exe for fusion binding log. All the settings are in registry and is discussed in my other article:

    http://blogs.msdn.com/junfeng/archive/2004/02/14/72912.aspx

    If you set the LogPath, you can go to the file system and browse the log manually. It should be obvious from the file name.

    Fusion is only responsible for finding an assembly. Loading the assembly is the responsibility of Loader and they are not integrated into fusion binding log. This is planned for v.Next.

    UI, yes, I am annoyed by the fuslogvw UI too but I suck at UI programming. I’ll look into that when I have time.

  3. Thomas says:

    We have moved from VS2003 to VS2005 for our C++ programs. One change is that the CRT is now, as you put it, "fusionized".

    Our programs are often installed by large corporations. Simple and reliable deployment is crucial. The installation is based on Windows Installer. This worked very well while we used VS2003. We need to support both "Per Machine" and "Per User" install modes.

    We have several products with some shared COM modules. We install the shared modules under Program Files/Common Files/*. The non-shared parts of the applications are installed in Program Files/*.

    We now have some problems:

    – We cannot use the “merge modules” for CRT that install in SxS since this prevents the installation to run in “Per User” mode.

    – We would rather not put a copy of the CRT in each directory. This would make the CRT load twice for each process and it prevents servicing in Windows 2000.

    It would be very nice if you could install things to SxS in a “Per User” mode installation. Why are you prevented from doing this today? Any ideas how we best should install CRT in order to:

    – Make a single installation program that can be installed “Per Machine” and “Per User”.

    – Avoid loading the CRT twice (or more).

    – Get “serviceability” in Windows 2000.

    See also my question here:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=183213&SiteID=1

  4. Thanks Thomas, very good questions.

    I’ll skip your last question, and answer your first two. That is not much you can do in Windows 2000 other than copy everything in system32.

    1. Per user WinSxs.

    .Net framework GAC *does not* support per user GAC. I am not sure where you get the information but we never support per-user GAC. See my article http://blogs.msdn.com/junfeng/archive/2005/05/24/421303.aspx for more detail.

    2. Avoid loading CRT twice.

    Yes, it is a known deficiency in the current Sxs architecture. Fusion/CLR dodges the problem with codebase hint.

    But since all of your apps are in local machine, you can use hardlink to workaround it: Only one copy carry the physical file. The others are hardlink to that one. You have some work to do but it should be doable.

    User installation apps are not the best enterprises want. Maybe you can find a way to install apps per-machine, but activate per-user?

  5. Thomas says:

    Thank you for your answer.

    The GAC does not have a "per user" feature as such, but you can install things to the GAC in a Windows Installer instatalltion running in "per user" mode. Just like you can install to System32 in that mode. The problem is that you cannot install to WinSxS in that mode. There is an explicit check for this and you get an error of you try.

    The reason I want to avoid multiple instances of the CRT is not to save disk space, but to save memory when the application runs. I don’t think hardlinks solves that. Or is the loader aware of such links?

    "Per user" mode in Windows Installer is something that is used by Windows Installer. When you use Group Policy to deploy software and want it to be "optional" you end up with a "Per User" mode installation.

  6. Thomas says:

    Just one more thing regarding "per user" installation mode in Windows Installer:

    "Per user" mode is not about installing binaries per user. Binaries are installed in Program Files etc. regardless of "per user" or "per machine" mode. The difference of these two mode is basically that some settings, that you choose, are written to HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE and that shortcuts are installed in the user profile instead of the "All users" profile.

    This means that the installation, regardless of "per user/machine" will install the binaries in the same way (Program Files, GAC, System32 etc.). The problem is that we cannot install things to WinSxS in "per user" mode because there is an explicit check in the "merge module" that you use to install the CRT for VS2005. This check gives an error if the installation is in "per user" mode.

    Why is that?

    As far as I understand, Windows Installer is the only way to install things to WinSxS. Is that correct?

  7. I asked the memory manager folks on the memory issue. They share the same page.

    I can’t help you on the MSI question though, but you can try to ask in MSI team’s blog:

    http://blogs.msdn.com/windows_installer_team/

  8. Greg Young says:

    1) Type.GetGenericArguments() is there a fringe condition where I may have to reorder the arguments I am given back? Each item also has a position, random testing says they are always in order but …

    2) Why the excitement about conditon variables .. I was under the impression they are roughly equivalent to events (posix compatibility?)

    3) What thoughts if any do you have on the breaking changed introduced in 2.0 dealing with floating point precision.

    http://geekswithblogs.net/gyoung/archive/2006/05/30/80119.aspx

    Thanks!

  9. Greg Young says:

    never mind my previous post .. I misread the top of your blog .. my mistake.

  10. Greg Young says:

    See code here http://geekswithblogs.net/gyoung/archive/2006/04/27/76533.aspx

    1) Why does the dynamic assembly load twice 🙂

    2) Why does the assembly which is set to be generated in memory still generate a file that can be linked to (it seems to me it always creates a temp file but as soon as you give it a name it no longer treats it as if it were an in memory assembly)

  11. Luca says:

    I have a .NET control hosted in a HTML page like this:

    <link rel="Configuration" href="/IEControl.dll.config">

    <object classid="/IEControl.dll#MyNamespace.MyClass"></object>

    This control needs to call the method "RemotingConfiguration.Configure (configFile)" to configure a remoting channel.

    Now, the argument ‘configFile’ cannot be an URL, so to make the call work, I have to download IEControl.dll.config in a local directory and then pass this local file to the RemotingConfiguration.Configure method.

    What I am asking is that since the config file is already in the IE cache and Fusion knows its path (I can see from its log), how can I get that path as well.

    Thanks

  12. I have looked all over MSDN documentation and in newsgroups and I can’t find a simple answer to this. Is there a way to programmatically enumerate assemblies in the GAC without just going to the file system? I know I can do it with gacutil but I want to diagnose an application running on end users machines and I’d like to do it "the right way" if there is such a mechanism. Thanks for any insight you can provide.