Today begins the exercise of setting up an Octopus Deploy server with the goal of using this for our deployments. Of course to get started I headed out and started reading the various documentation. When I got the part about creating the nuget packes via OctoPack I quickly ran into the following issue.
The process cannot access the file 'E:\Development\Source\PATHGOESHERE\_ReSharper.ProjectNamehere\PersistentCaches\000003.log' because it is being used by another process.
Now of course I know exactly why this is happening, its because when trying to create my NuGet package OctoPack is just grabbing ALL the folders/files under my source tree and there is a folder there called _ReSharper.ProjectNameHere which of course has locked files as they are being used…
Sadly though after a few minutes of googling and looking around on the Octopus site I did not find a quick solution :( However, if you read the documentation you will know that OctoPack simply adds a new .target (located under packages\OctoPack.1.0.109\targets) (the version may be different for you) file to your .proj file and it is this .target file which is causing the issue.
After spending some time digging and poking around the .target file I finally came up w/ a solution I could live with.
What I needed to do was use the –Exclude flag for the NuGet.exe command to tell NuGet to skip this folder. I did this by 1st creating a global property and 2nd updating the line which makes the NuGet command line call.
Adding the Property to the .target file
The trick above is that NuGet expects a file name, not a folder so you MUST use the **\ in front of the folder and the \** as the end.
Updating the command line call to Nuget.exe (this is line 122 in my file)
When I saved my .target file and rebuild the world was a happy place.
Now, I did log a bug for the OctoPack team to resolve this in a better manor, but until then this will work.
Till next time,
11-27-2012 6:08 PM