What is the dll.refresh file in ASP.Net?

In our ASP.Net web project, we seem to have some .refresh files associated with some of the third-party Dlls that we use. Any idea what they are and how / when they are created?

+73
Nov 03 '10 at 16:19
source share
3 answers

These files provide the path to the DLL in question to tell Visual Studio where to find it (you can check this if you open them in a text editor). They will be created every time you add a new link to the project.

Usually they appear when you use a project type that does not create a standard Visual Studio project file, since the paths to the associated DLL files usually go.

+59
Nov 03 '10 at 16:25
source share

From here :

In an ASP.NET project, adding a link to a file will add the .refresh file to the Bin folder. When the project is under source control, this file is then added to the original control. *.dll.refresh files that place the bin directory. Each time you add an external link, you will find the dll.refresh file next to it. These dll.refresh files are an exception to the rule, and they should go into the original control. This is the only way your web project will know where its links live.

+32
Nov 27 '10 at 6:56 p.m.
source share

Some information about updating files after trial and error. These experiments were performed using Visual Studio 2012. Links were added to the C # asp.net web project.

As discussed, adding an assembly reference through a view adds a .refresh file. However, if there are additional dependent DLLs on the explicitly added DLL in the directory that you are adding, dependents are also implicitly added, but without .refresh files! So, for example, I add a link to "MyAssembly.dll", I will also get "MyAssembly.dll.refresh". But if there is an assembly "MyDependentAssembly.dll" that "MyAssembly.dll" depends on the fact that I will not get "MyDependentAssembly.dll.refresh". So what happens is that one assembly is updated, but not its dependents! You have to add the DLL one by one in the reverse order of dependency, and then everything will work better.

Some other things to keep in mind. Adding "MyAssembly.dll" will also add "MyAssembly.pdb" if one is present. In addition, "MyAssembly.xml" will be added to the links, if present. These two files will be updated when "MyAssembly.dll.refresh" is present.

But when does Visual Studio decide to search for update files? Now remember that in a web project, the project file does not track a specific DLL link. You will not find the DLL specified in the project files for projects only. So, when does the update happen?

The answer to the question of when the update occurs is at build time, when it is necessary to download a downloadable link. This means that creating a pre-created updatable website may not capture all the DLLs. I continued to have a DLL that was not updated, and then I realized that it was only used inside the .ascx file. Removing the "Allow precompiled site for update" checkbox on the MSBuild Options project page fixed this problem for me.

However, if you add links to DLLs that are loaded via reflection in your code, they will not be updated via the link. You will need to use build events to copy them to the bin directory.

+3
Apr 11 '16 at 21:27
source share



All Articles