5

I have a client program written in C# where one of the projects in the solution handles a case which the machine has SQL 2005 installed.

I have added the relevant DLLs, but I get that warning:

CA0060 : The indirectly-referenced assembly 'Microsoft.SqlServer.ManagedDTS, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' could not be found. This assembly is not required for analysis, however, analysis results could be incomplete. This assembly was referenced by: d:\Any CPU\Bin\Debug\MyProgram.SSIS2005.dll.

According to properties of Microsoft.SqlServer.ManagedDTS it's version is 9.0.3042.0, I don't understand why it requires the version 9.0.242.0. I don't know if it related, but the version of Microsoft.SQLServer.DTSRuntimeWrap is 9.0.242.0.

What have I tried?

  • Deleting and adding the reference
  • Changing manually the version required in the csproj file
  • I thought about getting all dlls with the same version, but didn't find such a source at the web.

Any Ideas? Thanks, KM

EDIT: Another details,

  • My target framework is .Net 4.0
  • I have set the 'useLegacyV2RuntimeActivationPolicy’ to true
elirandav
  • 1,913
  • 19
  • 27
  • 3
    +1 for what you have tried. – rekire Dec 18 '12 at 06:46
  • What's sort of case? Also Check http://connect.microsoft.com/VisualStudio/feedback/details/519539/reference-to-microsoft-sqlserver-manageddts-dll-only-works-if-target-framework-set-to-net-4-0 – Kamran Shahid Dec 18 '12 at 07:02
  • The case where the machine running the app has SQL2005 installed – elirandav Dec 18 '12 at 07:03
  • 1
    A useful tool for debugging assembly loading problems is Fusion. Fusion logging comes with .NET, you just need to enable it, and use the Fusion Log Viewer: http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspx (Note that that was an extract from this [similar question](http://stackoverflow.com/a/5616685/1505426).) – Mightymuke Dec 18 '12 at 08:19
  • WhichDotNet Version are you using? – CloudyMarble Dec 18 '12 at 08:42
  • @Mightymuke, In my case I already know what is the missing dependency. the problem is that I have added the relevant dll, and the compiler is seeking for a different version for some reason. – elirandav Dec 18 '12 at 08:57
  • This error is generally caused by a 3rd party DLL trying to reference that particular version (ie, indirectly referenced assembly). While *you're* referencing the correct one, it looks like you don't know which DLL is referencing the version mentioned. The fusion logs should be able to tell you this, and you might be able to upgrade that particular DLL. – Mightymuke Dec 18 '12 at 09:11
  • I'm not sure how clear that is. I believe you have something like this: `MyProgram.SSIS2005.dll` <- `Something` <- `Microsoft.SqlServer.ManagedDTS`, and you need to find out what `Something` is. This is where Fusion can help. – Mightymuke Dec 18 '12 at 09:15
  • Also take a look at [Assembly Binding Redirection](http://msdn.microsoft.com/en-us/library/2fc472t2(v=vs.100).aspx), it may help resolve the issue without the need to change / update any references. – Mightymuke Dec 18 '12 at 09:19
  • Also if you're really using FxCop you could potentially change the `AssemblyReferenceResolveMode` setting (see [this post](http://davesbox.com/archive/2008/06/14/reference-resolutions-changes-in-code-analysis-and-fxcop-part-2.aspx) for details). This works fine with the latest FxCop, but I'm not sure how you'd set it for the internal code analysis engine. – Mightymuke Dec 18 '12 at 09:25
  • @Mightymuke, I see what you mean. I will try using first the Fusion tool and then the other suggestions. Thanks. – elirandav Dec 18 '12 at 10:13

4 Answers4

0

Try to add the reference from:

C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.ManagedDTS

And set the Local Copy for the reference in VS to true, hope this helps.

CloudyMarble
  • 36,908
  • 70
  • 97
  • 130
0

As far as I know SQL CLR is not currently compatible with .NET 4.0, you should try switching to 3.5 and see is that helps.

rekordboy
  • 146
  • 1
  • 1
  • 5
0

Check for the version of the system by going to:

C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.ManagedDTS

If they are different then click on Add reference and follow the link to add the same.

Also in web.config, under the assemblies tag remove the one with the older version.

always-a-learner
  • 3,671
  • 10
  • 41
  • 81
0

As @Mightymuke mentioned in the comments, Fuslogvw.exe shows which DLLs were loaded. One of my projects had a reference to DLL that referenced an old version of Microsoft.SqlServer.ManagedDTS.

elirandav
  • 1,913
  • 19
  • 27