Question

I have an ASP.NET application which relies on an external assembly which is not in the GAC. The app has a .refresh file which copies the assembly into the bin directory when the app is compiled.

When I install the app on a production server (by copying the app files into a virtual directory), the bin directory is not updated automatically by the presence of the .refresh file like I thought it would. I tried using the aspnet_compiler tool but that doesn't work since it expects the assemblies to be in the bin directory already.

How do I get .NET to update the app's bin directory without visual studio?

Was it helpful?

Solution

The .refresh files are just there so that VS knows that it should keep track of the originals, and if they have changed, copy a new version to the /bin folder. They are just text files with a path to the original - the modified date is used for the comparison.

When you say:

When I install the app on a production server (by copying the app files into a virtual directory), the bin directory is not updated automatically.

What exactly do you mean? Are you not also copying the contents of the bin directory to the production server? You will need to deploy any dependant assemblies with the application.

OTHER TIPS

Clearing the cache directory of asp.net might help :

C:\WINDOWS\Microsoft.NET\Framework\
FRAMEWORK_VERSION\Temporary ASP.NET Files\YOUR_APP_NAME

Delete those .refresh files.

Make a simple build script (using whatever you want cmd, NAnt, Rake, psake ...) that:

  • copies those files to your asp.net app folder
  • build you asp.net app.

Or you can edit your .csproj file and add something like:

<ProjectExtensions>
  <PropertyGroup>
    <PreBuildEvent>copy c:\path\to\dll\files $(ProjectDir)$(OutDir)</PreBuildEvent>
  </PropertyGroup>
</ProjectExtensions>

This will add a pre build action that will copy your dll files to the output dir of your asp.net app. You'll have to build it with MsBuild

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top