6

I have the following situation:
Solution with

 - Project 1: Web_Application (VB.NET Web Application)
 - Project 2: Code_Library (VB.NET DLL, Referenced in Project 1, References My_Reports, My_SQL)
 - Project 3: My_SQL (Embedded SQL scripts C# DLL, referenced in Code_Library)
 - Project 4: MyReports (C# dll, depends on ReportViewer),  
              referenced in Code_library, copyLocal = true
              unfortunately depends on
                   - Microsoft.ReportViewer.WebForms.dll (copyLocal = true)
                     which depends on
                   - Microsoft.ReportViewer.Common.dll (copyLocal = true)
                   - Microsoft.ReportViewer.ProcessingObjectModel.dll (copyLocal = true)
                   - System.Web.DataVisualization.dll (copyLocal = true)

The ReportViewer dll's are set to localcopy in the MyReports project
In Code_Library, MyReports is set to localcopy
In Web_Application, Code_Library & MyReports is set to localcopy

This gives the following very dissatisfying result:
In MyReports, the ReportViewer dll's are localcopied to the output directory.
In Code_Library, MyReports.dll is in the output directory, but the ReportViewer dll's are not ...
In Web_Application, CodeLibrary.dll & MyReports.dll are in the output directory, but the ReportViewer dll's are not...

Why ?
Is there anything I can do (short of adding the reportViewer dll's to my Web-Application project ?

I absolutely don't want to add the ReportViewer as depencency to Code_Library, since then I have to update 2 locations, if I want to change to a higher version of ReportViewer.

Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
  • Opened connect issue https://connect.microsoft.com/VisualStudio/feedback/details/2035442 – Stefan Steiger Nov 19 '15 at 16:23
  • Are the problematic dlls part of your GAC on the development machine? If so, removing them may help visual studio to realize the need to satisfy local dependencies. – grek40 Nov 19 '15 at 16:52
  • @grek4: Most likely they are in the GAC. I can't remove them, I don't have admin rights. Neither have the other developers. I also have SQL server express & Management studio installed, so I can't say if these assemblies are installed with a standard .NET 2.0 installation. Additionally, the .NET 2.0 dll's probably won't be there on a production machine, if it runs on a .NET 4.0 app-pool. – Stefan Steiger Nov 19 '15 at 23:38
  • 1
    I can unserstand that you can not tamper with the servers, but if you don't have admin rights on your own development environment and thus can't adjust it to the target environments, this is an organizational problem in your company and you should really bring it up there instead of finding workarounds here. Maybe you get local admin rights if you point out the hours of wasted (payed) time. – grek40 Nov 20 '15 at 09:39
  • @grek40: That's true, but you'll have better luck explaining a cat that catching birds is bad than explaining this to our boss. Believe me, all of us tried. Besides, he just doesn't want that illegal software gets installed by anyone. That's a legit concern, I suppose... Besides, you can do pretty much anything without admin rights. Just start/stop services and IIS administration (and SSL certificates), modify gac, modify HKLM in registery, you can't do. It's actually interesting. – Stefan Steiger Nov 20 '15 at 13:25
  • Addendum: Published to the test server, and can now safely say that these assemblies are not installed with a standard .NET 2.0 Installation. – Stefan Steiger Nov 23 '15 at 15:36

1 Answers1

0

I have a few options:

  1. GAC the references you dont want to copy
  2. Reference them in the app.config file - ala this
  3. Add a postbuild event to copy the files to where you need them...

You could check out where the application is looking for the files by enabling fusion logging.

Community
  • 1
  • 1
Sam Makin
  • 1,526
  • 8
  • 23
  • Option 1 is impossible, since I don't have admin access on our customer's servers. Option 2 is very dissatisfactory, as multiple Web_Application projects (for various customers) use Code_Library. Option 3, with fixed paths, will work only on my computer. With relative paths, will work only on those computers which have the same directory structure. – Stefan Steiger Nov 19 '15 at 16:16
  • You could potentially embed the indirect references in the referenced project ala [this](http://stackoverflow.com/a/13766575/2319909) – Sam Makin Nov 20 '15 at 09:49
  • Hmm, ilMerge would be an idea. – Stefan Steiger Nov 20 '15 at 13:10