C# – how to resolve this .Net 3.5 warning/error

.net-3.5c++compiler-errors

I have three machines. one installed VS2008 another two installed SDK6 and Framework3.5 (one of these two is a build machine).

When I use MSBuild to build our application, all of them get this warning:

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

and the build machine comes with some errors:

scsm\SCSM.cs(234,13): error CS1501: No
overload for method 'Invoke' takes '1'
arguments scsm\SCSM.cs(235,13): error
CS1501: No overload for method
'Invoke' takes '1' arguments
scsm\SCSM.cs(304,13): error CS1501: No
overload for method 'Invoke' takes '1'
arguments scsm\SCSM.cs(314,13): error
CS1501: No overload for method
'Invoke' takes '1' arguments
scsm\SCSM.cs(317,13): error CS1501: No
overload for method 'Invoke' takes '1'
arguments scsm\SCSM.cs(323,17): error
CS1501: No overload for method
'Invoke' takes '1' arguments
scsm\SCSM.cs(324,17): error CS1501: No
overload for method 'Invoke' takes '1'
arguments scsm\SCSM.cs(325,17): error
CS1501: No overload for method
'Invoke' takes '1' arguments

but other machines are passed without error. Resources are identical in those three machines.

searched online but cannot find answer. Anybody here can help me resolve this?
thanks

Best Solution

Could not locate the assembly "WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35".

WPFToolkit is not part of the .net Framework but a component that can be downloaded.

Did you download and copy the WPFToolkit-DLL to some place on the build machine where your project can find it? (either some directory set in your project references or the GAC)


scsm\SCSM.cs(325,17): error CS1501: No overload for method 'Invoke' takes '1' arguments

In my experience, this problem can mean that you are missing SP1 for .net Framework 3.5.

EDIT: After seeing your code, I'm pretty sure this is the problem. Dispatcher.Invoke(delegate, params object[] args), which you are calling here, was added in Framework 3.5 SP1, see the MSDN page of this method:

Supported in: 3.5 SP1, 3.0 SP2

Related Question