Happy Coding and good luck to all of you. Smile and shake my head knowing that this hack might not work after the next SP. Move my app.exe file to a new directory using Unique Filename. Move my file to a new directory using Unique Filename
Create a string I can use for filenames based on the exact Date/Time in a format that can be used by the Filesystem I centralized the output of all of my projects to a single folder (personal preference really) Since I have done this, I've been able to compile to my hearts content (Barring any "real" problems). In this manner, there will never be a naming conflict! This follows for the 3rd line as well. Then on the second command, it will use this string in the move command to get the EXE moved to a different directory (Trash), but it will change the filename from "" to You should end up with something like this "yyyyMMdd_HHmmss.ss". After you have committed that line, type the following: To ensure that this isn't a problem, simple copy the line and paste it into your MS-DOS Command Prompt. You have to be careful in using the command above because it might change based on localization (?). If exist "$(TargetPath)" move /Y "$(TargetPath)" "$(SolutionDir)\build\trash\%BaseName%.exe"įor those of you who do not remember (or know for that matter) you good ol' DOS commands, that first line is simply creating an Environment Variable that takes the current date and time and formats it into something that can be used in a file name. If exist "$(TargetPath).locked" move "$(TargetPath).locked" "$(SolutionDir)\build\trash\%BaseName%.locked" So Here are the 3 command lines that I put in my Pre-Build to fix my problem: But, I can rename the file during the move. Even when you give the move command the /Y option. Of "Move app.exe to new folder" won't work. Well, this means that they cannot be overwritten either. Everybody have your MS-DOS hats on?!?! I've already stated that I can move the files, but I cannot delete them. The act of getting these 2 files out of my Buildīut this brings me to the next issue I had to overcome. What was interesting was, even though after I moved them, I still couldn't delete them. However, I found that I COULD move the files (Thanks Matthew). Whether from the cmdline, or Explorer, or the Pre-Build(JustĪ commandline anyway.right?). VS2010 was actually generating a *.Locked file for each of my projects, but I found that it was the lock files for my EXE project that matttered. I was unable to Delete either of these file.period. I found that VS2010 was getting hung up on the Output from my EXE Project (Lets just call it "app"). I also had to move the file it was locking against. However, just moving the lock file wasn't enough for me. Ok.with all that said, here is what I've found in my case:Īt the Top of the Thread Mathew Wright stated, move the lock file somewhere else. The directory manipulation I've done with my projects does nothing to help nor hinder the problems that we've all be facing with the IDE (VS2010 in my case) from erroring out with the "file in use" error.
#How to debug in visual studio 2012 with dll reference how to
Not sure how to configure these normally but just change the file seemed to do the trick. Modify C:\Windows\Microsoft.NET\Framework\v9\ (back it up first). I don't know what causes the issue, but here's what I did that seemed to work for me (other solutions above didn't) in VS2010: