views:

1142

answers:

3

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?

A: 

Clearing the cache directory of asp.net might help :

C:\WINDOWS\Microsoft.NET\Framework\
FRAMEWORK_VERSION\Temporary ASP.NET Files\YOUR_APP_NAME
Canavar
nope. doesn't help.
Ferruccio
+1  A: 

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.

Zhaph - Ben Duguid
No, I'm not copying the contents of the bin directory. I had assumed that, since the referenced assembly is installed separately, that it would need to be also installed on the production machine and that installation would get copied automatically into the bin directory. So, I'm thinking this means that if I copy the assembly as well, then I don't need to worry about installing it on the production machine in the first place. it will just be part of the app installation.
Ferruccio
Well, to be honest, that depends on what the installer does - if all it does is unpack some files (samples, help and dlls), then no, you wouldn't have to install the production machine, just copy the referenced DLLs. If it does other configuration stuff, then you'll need to make sure those steps are completed on the production machine. But generally, if you can run it locally with the dll in the bin folder, then you should be able to just copy them to production.
Zhaph - Ben Duguid
A: 

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

ppiotrowicz