ASP.NET .NET 4.6 MVC4 application loads unnessecary assemblie, eq. System.Data.OracleClient . Oracle is not used.
Assembly dependencies are created using code in con
There are three kind of assemblies on a web application.
In the first one case, you can optimize yours libraries, removing any unnecessary reference direct on the project of your dll.
In the second case to optimize your web page and what to compile you need to remove any unnecessary reference on the code behind... eg page usually have this first lines
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
and what you do not use there are gray, you can remove it...
And now the difficult part - difficult because you must play the "try/fail" game. Now what you can remove and from where.
First where to I search to find what to remove... and the answer is on global web.config on asp.net. In my case I go to windows directory, on my curent framework version, on config directory and find the web.config
There I locate some keys....
First you can remove unnecessary Http Modules for faster pipeline in the httpModulesession on web.config
This is what I see on global web.config
and I go to web.config on my application and this is how I remove what I am not use:
Now for you case I continue on assemblies session, this is what I see on global web.config:
this as it is I copy/paste to my web.config and place on first line then I start remove the lines that I KNOW that my program is not use... and be careful to keep this line and at the end, this says to add your library from your dll directory.
....
Making this and removing the one that you not use, by remove and see if your application is still working, you can limit a lot the assemblies that you use.
I make a simple test and by removing this line
I count from 83 down to 79 only assemblies loaded this time. Why more than one minus ? because WorkflowServices loads some more by them self.
To remove something from configuration section, again on your web.config you do it as:
...