I have a method that looks like this :
Function ExecuteAndLogError(Of TResult)(ByVal code As Func(Of TResult), _
ByVal sql As String, _
Optional ByVal parameters As SqlParameterCollection = Nothing) As TResult
End Function
I am getting this compiler error :
‘Func’ is ambiguous in the namespace ‘System’.
This is the line that has the problem
Func(Of TResult)
These are my references for the website

This is what I’m importing
- Imports Microsoft.VisualBasic
- Imports System.Data.SqlClient
- Imports System.Data
- Imports System.Diagnostics
- Imports System.Linq
Did I forget to import something or add a reference to something?
More Info
I recently upgrade my website from Visual Studio 2005 to Visual Studio 2008.
Here is what I did to fix this problem.
I went to the object explorer in Visual Studio and searched for
Func. I had two references to everything inSystembecause I had imported a library, Newtonsoft.Json. Because I had upgraded my website from 2005 to 2008 Newtonsoft was still referencing the 2.0 framework. So, I just deleted my reference to Newtonsoft and that fixed my problem.