1

My application targets the .NET Framework 3.5 client profile and my setup is configured to install this framework using the online installer, but sometimes (at 3 users out of 12000) the application throws the following exception:

Method not found: 'System.Windows.Threading.DispatcherOperation System.Windows.Threading.Dispatcher.BeginInvoke(System.Delegate, System.Object[])'

I also receive the following warning from the Visual Studio 2010 Code Analysis tool:

Warning CA1903 : Microsoft.Portability : Member 'Settings.SearchForApplicationRelease_bgWorker(object, DoWorkEventArgs)' uses member 'Dispatcher.Invoke(Delegate, params object[])'. Because this member was introduced in.NETFramework 3.0 Service Pack 2, which was not included in the project's target framework, .NET Framework 3.5, your application may fail to run on systems without this service pack installed.

I have tried on several systems but I am not able to reproduce this exception.
How can I fix it?
Are there any chances that the users have a corrupt version of the .NET Framework?

Thanks, Cosmin

casperOne
  • 73,706
  • 19
  • 184
  • 253
user744877
  • 51
  • 3
  • You should be able to fix it by upgrading the user to .net 3.5 full, not client profile, as client profile does not had the full functionality. – Jethro Jul 12 '11 at 06:48
  • @Jethro: Not necessarily. In this particular case, it _should_ work for the client profile as long as he has .NET 3.5 SP1 (according to that overload's [page](http://msdn.microsoft.com/en-us/library/cc190824.aspx)). – Jeff Mercado Jul 12 '11 at 06:54
  • @user: I don't suppose you have at least .NET 3.5 SP1 installed do you? – Jeff Mercado Jul 12 '11 at 06:55
  • Yes, but the project targets .NET Framework 3.5 Client Profile. Shouldn't the compiler throw an error if the client profile doesn't contain that method? – user744877 Jul 12 '11 at 06:56
  • @Jeff The documentation for the client framework specifies that it will install some components if not all of them from the .NET 3.5 SP1. I used ILSpy to see the actual implementation of the Dispatcher in WindowsBase.dll and everything looks OK. I think that these users have a problem with their installation of the NET framework – user744877 Jul 12 '11 at 07:00
  • @user: The reference page for that overload (which I've linked to in my comment to Jethro) lists it being supported in Client Profile 3.5 SP1. If the problem is occurring only on some user's machines, you should verify that they have at least .NET 3.5 SP1 installed. – Jeff Mercado Jul 12 '11 at 07:02

1 Answers1

0

Microsoft documentation states this method is compatible with .NET 3.0 and up. However Micosoft .NET 3.5 sp(0) ->Not service pack 1<- is broken and does not support any BeginInvoke methods. There are other issues with .NET 3.5 sp(0) and it should be removed from existance. You will have to force the update to .NET 3.5 sp(1) for this method to work.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92