Welcome to MSDN Blogs Sign in | Join | Help

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.

I have left fusion team. I can still answer questions about fusion and SxS. For feature/change suggestions, you can try Alan Shi, or many of the CLR bloggers.

Thanks for reading.

Published Tuesday, December 05, 2006 1:27 PM by junfeng
Filed under:

Comments

# re: Questions and suggestions

Tuesday, December 12, 2006 11:28 AM by Carlos

Obvious question: what are you doing now and will you be blogging it?

# re: Questions and suggestions

Tuesday, December 12, 2006 3:00 PM by junfeng

I work in Windows Live now.

You can probably tell from my recent articles. I probably will talk about random programming questions.

I still have a few things wanted to discuss in the assembly binding though. When I get time I will post them.

# re: Questions and suggestions

Monday, December 18, 2006 9:12 AM by SaravanaMV

Some time my GAC folder is empty, it shows 0 files. I normally try few things like closing all instances of visual studio, reset IIS, reset Biztalk(since thats my day job) shut down antivirus etc etc....it works some times...else i need to do a reboot....any idea why this is happening??

Regards,

Saravana

# re: Questions and suggestions

Wednesday, December 20, 2006 3:19 PM by Colin Finck

I have a question concerning SxS: I want to use the VC80 CRT on WinPE 2.0.

How can I do this?

I already copied the folder, which contains the "msvcm80.dll", "msvcp80.dll" and "msvcr80.dll" files into the WinSxS folder of the WinPE.

But when I try to start a test application, which is dynamically linked to these files, I get a side-by-side configuration error. A trace with "sxstrace.exe" shows a "Did not find the assembly in WinSxS" error. Do you know what I am doing wrong?

Statically linked applications work without problems.

BTW, is there another way to get in contact with you (i.e. by E-Mail) than just this blog?

Thanks in advance and best regards,

Colin Finck

# re: Questions and suggestions

Thursday, December 21, 2006 1:28 PM by junfeng

Saravana,

I have no idea. Sorry.

Colin,

You can't xcopy files to winsxs directory in Vista, and expect it to work. (when you say WinPE 2.0, I assume it is Vista).

You should look into using the API to install it.

http://msdn2.microsoft.com/en-us/library/aa376204.aspx

# re: Questions and suggestions

Wednesday, January 10, 2007 4:08 PM by JohnL

Have a question about the ResourceResolve event.

Our product is using satellite assemblies for localization.  To get localized strings we call ResourceManager.GetString().

The tricky part is we're trying to deploy the resource files on-demand from a server.  When the code hits the GetString call, the ResourceResolve event is triggered.

My event handler code downloads the file, installs it into the GAC and returns an Assembly object.  But the GetString call asserts with a MissingManifestResourceException.

But, because I installed the file into the GAC, the next time I run the resources work fine.

There must be a difference between me returning an Assembly oibject and when it gets the resources from the GAC.  Any ideas?

Thanks

# re: Questions and suggestions

Wednesday, January 10, 2007 4:15 PM by junfeng

This may have been caused by the caching of assembly binding failures in .Net framework 2.0.

http://blogs.msdn.com/junfeng/archive/2004/07/22/190813.aspx

# re: Questions and suggestions

Wednesday, January 10, 2007 4:47 PM by John L

I think i have a theory.

The assembly I'm returning has a culture of 'en', but the threadCulture is set to en-US.

If the ResourceResolve event asks for an en-US assembly and I return an assembly with an 'en' culture, will that cause it to fail?

# re: Questions and suggestions

Friday, January 12, 2007 1:29 PM by john.carneiro

I am having a Fusion API issue when using the CreateAssemblyCache() and InstallAssembly() calls descibed

described in the online doc:

http://www.grimes.demon.co.uk/workshops/fusWSTen.htm

Here is the main  doc:

http://www.grimes.demon.co.uk/workshops/fusionWS.htm

In this the .NET 2.0 C# code snippet.

I am basically installing an assembly in the GAC using the fusion API

under an app domain. After successfully installing it I try

loading it using the full name (an.FullName = "Waters.Scheduler.Resources", Version=1.0.0.0, Culture=neutral, PublicKeyToken=9248a9e9e65bdbea")

and it fails to load

a = Assembly.Load(an.FullName);

Interestingly, when I exit my program and restart it then finds it ok.

Does the fusion API somehow need be refreshed somehow?

Does the fusion API need to be called from another app domain for the

Assembly.Load(an.FullName);

to recognize the GAC assembly?

I was thinking a seerate process then may need to install the assemblies in the GAC, then load

them on the main process.

Or is this a bug or I am using the API the wrong way?

The AssemblyCache.InstallAssembly() method calls the fusion API via some wrapper code arround the API.

Thanks for any help given.

-

//***********************************************************

// If assembly is signed, then add it to the GAC

//***********************************************************

if (localAName.GetPublicKeyToken() != null && localAName.GetPublicKeyToken().Length != 0)

{

   // Impersonate EverestUser account

   tokenHandle = IntPtr.Zero;

   dupeTokenHandle = IntPtr.Zero;

   // Call LogonUser to obtain a handle to an access token.

   bool returnValue = LogonUser(adminUserName, null, adminPassword,

       LOGON32_LOGON_SERVICE, LOGON32_PROVIDER_DEFAULT,

       ref tokenHandle);

   // Check return value

   if (!returnValue)

   {

       throw new DeploymentException("LogonUserFailed");

   }

   else

   {

       // Impersonate everest service user

       try

       {

           bool retVal = DuplicateToken(tokenHandle, SecurityImpersonation, ref dupeTokenHandle);

       }

       catch (Exception e)

       {

           throw new DeploymentException("DupTokenLogonFailed", e.Message);

       }

       // The token that is passed to the following constructor must

       // be a primary token in order to use it for impersonation.

       WindowsIdentity newId = new WindowsIdentity(dupeTokenHandle);

       WindowsImpersonationContext impersonatedUser = newId.Impersonate();

       try

       {

           // Install assembly into the GAC

           // The force flag forces the reinstall of an assembly regardless of any

           //    existing assembly with the same assembly name

           AssemblyCache.InstallAssembly(localFileName, null, AssemblyCommitFlags.Force);

       }

       catch (Exception e)

       {

           throw new DeploymentException("GacInstallFailed", e.Message, localFileName);

       }

       finally

       {

           // Stop impersonating the user.

           impersonatedUser.Undo();

       }

   }

}

// delete the local copy, since we only need it in the GAC

File.Delete(localFileName);

// this fails to find the assembly in the GAC

Assembly a = Assembly.Load(an.FullName);      

# re: Questions and suggestions

Friday, January 12, 2007 1:33 PM by junfeng

John L,

I think it is possible. But I am not the best person to answer your question, as I don't know much about resource loading. Try to ask in BCLTeam's blog.

# re: Questions and suggestions

Friday, January 12, 2007 1:37 PM by junfeng

john.carneiro

I haven't tried the scenario you described. There is no caching for assembly in GAC. So your scenario in theory should work.

If you want me to guess, I will probably say it is caused by the same caching binding failure breaking change above.

In any case, fusion binding log is your friend.

# winsxs on Vista Home Premium

Thursday, February 22, 2007 10:39 PM by Sean M

On my newly installed Vista Home Premium setup, I appear to be missing the folder for Microsoft.Windows.Common-Controls in the WinSxS folder. Is this intentional? I cannot embed a manifest referencing the version 6.x common controls in Visual Studio 2005 without it. Is there a way to fix this?

# re: Questions and suggestions

Tuesday, February 27, 2007 2:50 PM by junfeng

Sean,

Common Control is still in Winsxs. It is used by every UI component in VIsta.

# re: Questions (DEVPATH)

Thursday, March 01, 2007 2:34 PM by spacattac

Your descriptions on DEVPATH were helpful, but I'm still having a problem.  I have a VS2005 solution where my NUnit project does just fine finding the Assemblies in my DEVPATH but my Web Site project fails to find them.

Any thoughts or suggestions?

Thanks,

Lane

# re: Questions and suggestions

Thursday, March 01, 2007 2:47 PM by junfeng

spacattac,

I believe it is a bug in .Net framework 2.0, and there is a QFE available.

Please contact Microsoft Product Support Service for more information.

# re: Questions (DEVPATH)

Friday, March 02, 2007 10:52 AM by spacattac

junfeng,

You were absolutely correct.  You have to go through Support and there is a QFE - if anybody else needs it have them refer to KB Article Number(s): 931338

Thanks!

Lane

New Comments to this post are disabled
 
Page view tracker