Can't delete a ghost file in my .NET Web Site that prevents publishing - asp.net

This is really frustrating me. I file I have continually gets recreated, but not really. It appears in my project, it appears in Windows Explorer, but I can't open it, it says the file doesn't exist. If I try to delete it, it says it cannot find the item, BUT if I try to delete it, it says it failed, then refresh, the file is gone. But if I go back into my project and refresh the directory, it shows up again both in the project and explorer.
Now I've read this can be caused if you have low RAM and are doing a lot of operations, however I've got 16gb ram and just am using one instance of VS, so that can't be it. I've also read that restarting the computer helps. Well when I restart, I can see the file there sometimes, sometimes not. If it's there I can F5 and it's gone. BUT as soon as I either try an SVN update (even though it doesn't update/add anything in the svn log box), or try and build the project, or just refresh the directory from within visual studio again, the ghost file appears.
This is preventing me from publishing the website because every time I go to publish it, it throws an error telling me that ghost file is missing. But there is no file indicator in the error message and searching the entire solution for any references to it returns no results...so I am at a loss for what to do.

My best suggestion is to create a new Web Site project in a different folder and copy the files over. It sounds like your project file is damaged.
Alternatively, this could be caused by Adding an existing item as a Link, which by default doesn't get included when you publish a (web) project.

Related

How can I debug an Web (ExtJS) .Net application

I have inherited an ExtJS project that uses ASP.NET Web Handlers (ashx files) to access a database.
I'm trying to debug the connection to the database which is in the C# portion of the code.
I've tried adding a break point just before the connection to my database is made, but I can't seem to get the application to stop there. They only briefly turn white during debug-execution. Hovering the mouse over the breakpoint when it's in that state shows:
The breakpoint will not currently be hit. No symbols have been loaded for this document.
I've been all over this question, with no better results
In the modules window, the Symbol Status of the DLL does indeed show Symbols Loaded.
The dll/pdb both seem to be copied over to C:\Users\myid\AppData\LocalTempTemporary ASP.Net Files\etc.
(this seems odd, because I would expect it to attach to the .dll in my work folder) Is there a way to tell the debugger to look there instead?
There of course is no exe since this is a web app.
I've:
tried cleaning the solution and rebuilding fresh including a fresh pull from the repository.
verified the build has the "Define Debug Constant" and "Define Trace Constant" are checked
deleted the contents of Temporary ASP.NET
checked the the project was set as Debug
checked that "Just My Code" was disabled in Debug / General
restarted the workstation completely
checked that the Solution has the right project starting (there's only one in it)
checked I'm building in debug (not release)
made small changes to the code to force a recompile
checked that "Automatically determine the type of code to debug " is selected in Attach to Process
run as administrator
checked Optimize Code is not turned on in the project properties
checked that "Use Managed Compatibility Mode" is turned off
There is no aspx involved so the CodeBehind/CodeFile issue is moot.
Beyond that, that answers are very much repetitive or I tried something at random and it worked.
What have I missed? Is there something basic that you are supposed to do with the project so it will let you debug the DLL that perhaps the original developer didn't do (no they aren't available to me)?
Problem resolved...
Ultimately there were two issues.
Originally, the DLL had been compiled as 32bit DLL which didn't play nice with the database (Oracle 64bit). Switching the platform target should have resolved the issue except, IE's cache of the web page hid the fact that I was now getting a classic "Could not load file or assembly xxx or one of its dependencies." error. [incidentally, I've now sett he cache to clear on exit]
This error was caused by IIS Express running in the 32 bit version instead of the 64 bit version. Which means the DLL never really run, and explains the "No symbols have been loaded for this document." warning.
That was then resolved by going to Tools -> Options -> Projects and Solutions -> Web Projects and turning on Make sure that Use the 64 bit version of IIS Express for web sites and projects.
Clean and rebuild, and everything works tickety-boo

RStudio project "cannot find the file specified" on R session restart

I am getting strange and annoying behavior in one (yes, only one) of my RStudio projects. Whenever I restart the R session within this project, I can no longer save any of the files, and when I try to (or RStudio tries to automatically) I get a popup error saying "The system cannot find the file specified" and I have to reopen the project and all of the R scripts.
I looked at the log file, and I see a lot of the following error:
07 Oct 2015 00:52:05 [rsession-Mark] ERROR system error 5 (Access is denied) [path=C:/Users/Mark/GoogleDrive/Research/CEQUAL_event/.Rproj.user/5E5F98D9/sdb/s-26E44539/lock_file];
OCCURRED AT: bool rstudio::core::FilePath::exists() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:308;
LOGGED FROM: bool rstudio::core::FilePath::exists() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:308
It looks like the problem may be in the .Rproj.user folder. So I deleted that and let RStudio regenerate it, but the behavior started right back up again.
I am using Windows 7, RStudio version 0.99.441, and R version 3.2.2.
I think #Jack Wasey is right: Google drive locks files during sync. This causes many issues with other programs as well. There are alternatives from companies that do file syncing for a living, such as dropbox, whose clients don't lock files. With google drive you only have the option to use selective sync and exclude every .Rproj.user folder. Once the RStudio's database is corrupted, moving the project out of the Google drive folder won't be enough - you will need to delete/rename it to have RStudio fix its database.
Summary:
Copy contents from all unsaved files to a temp file outside of RStudio (while clicking away the error message every other second)
Quit Rstudio
Pause Google drive syncing
Rename (or move/delete) the hidden .Rproj.user folder in your project
Reopen the project in Rstudio
Exclude the new .Rproj.user folder from syncing with Google drive (Preferences -> sync only these folders)
Remember that Google drive is free / Become an awesome google developer and fix the issue once and for all
May not be related but might be helpful to someone else. I was getting the same error (over and over) and finally realized that I had an R session open from days ago, that had eventually gotten stuck. It was running in the background with a "Fatal Error" message waiting for me to click OK. When I closed that session everything started working again.
This was happening to me as well, but curiously only when I was using Project files (.Rproj - not stand alone R scripts). It was driving me crazy.
I found that buried in the settings (Tools -> Global Options -> Git/SVN) there was a setting "Enable Version Control Interface for RStudio Projects). I guess I had turned that option on when I was messing with my settings and then forgot about it since I don't normally use project files.
What worked for me was I noticed DescTools package I installed caused it, though it served the purpose I installed it - fetched me mode value without going through mode functions. I then deleted the line I got the install.package, re-saved the project (ctrl S) and I could knit it.
Bottom line, read the error message soon as the box pops up, it's going to give you a hint of what line is causing the issue.
I hope this works. Enjoy

<myapp>.app.dsym file gets deleted when I build my project

I am building my first iPhone app. I am using XCode 3.2.6. Everything was ticking along fine when all of a sudden, I get this strange build error. The message is shown below:
GenerateDSYMFile build/Debug-iphonesimulator/buddy.app.dSYM build/Debug-iphonesimulator/buddy.app/buddy
!error: unable to open executable"
From what I have managed to figure out, there is a file called buddy.app.dSYM that resides in my /build directory. If I clean my project, then build, it appears and everything is fine. However, if I build a second time, I get the error. If I build a third time, the error is gone, 4th time, I get the error again. And so on.
The error is consistent with the presence (or lack of) my buddy.app.dSYM in my build directory. ie, it is created, deleted, created, etc ...
So it seems like something is deleting the buddy.app.dSYM file every other build.
I recently started working with SQLite in my project. Other than that I can think of no major changes I have made to my project.
Any ideas?
Update
I can't put this as an answer because I am new to the system and not allowed. But .....
A: I think I figured it out. I struggle all day and then 5 mins after I post I get the answer. Figures. Anyway, it was to do with the SQLite database I had included in my project under the Resources tab. I had included it, but then deleted the .sql file. I recreated the file, but with a different name.
So I removed the file from my project and reimported the new .sql file. And no problems since.
I have no idea why this created such a funny error. If anyone knows, please post.

XCode 4 hangs at "Loading Project"

I don't have much to go on... XCode 4 is hanging at startup with "Loading Project". My build fails but I can't access the errors. This is happening with a project that worked in a previous version of XCode. It also happens for new projects.
I had a simliar issue. I deleted project.xcworkspace and xcuserdata inside the .xcodeproj directory and I was able to open the project file.
Having the same issue at the moment, it was after pressing Continue a bunch of times on some internal logic errors. I think the .xcodeproj file is corrupted. Are you sure it won't even work on new projects?
My solution would be to delete it and create a new one, re-add all of the dependencies, build settings and existing source/resources, and then restart Xcode and try opening the project again. It should work this time. It has for me anyway.
Another issue could be if you're creating a new project on network storage and then it's somehow not loading all of the associated files because of a network error. Try moving the files to local storage if this is the case.
I had a similar issue which ended up being caused by a folder named "~" in my application resources directory. Deleting this directory resolved the hang.
I had the same issue, Xcode 4, after trying to add a framework and Xcode added everything under Xcode.app. It did not hang with the processing gear forever probably because my computer uses an SSD drive. After many minutes of the spinning gear, it was loaded and I removed the 'Reference' (right mouse click).

Problem with built assembly not matching source when debugging under IIS 7.5

I have a problem debugging a web forms application that is configured to use IIS for debugging, under Windows 7 and Visual Studio 2010. An example has just occurred, where I make a change to the code behind for a web form, save, and apparently rebuild before starting the app using F5.
The app starts, and I get an error message trying to do something in the app. I tell the debugger to break when an exception is thrown and try my task again, only to be told
The source file is different from when the module was built.
where the module is C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\9d7b45ca\11a98b19\assembly\dl3\5e6cf0b2\636409d4_dfeecb01\PerfixEMS_Admin.DLL
The physical folder for my test web site is set to the web application project's source folder, so I have always assumed that IIS will look in the bin folder for required assemblies, and these will be rebuilt as expected. Why is this not happening?
Cleaning the solution usually works for me.
Update
Given the high number (320) of projects I understand why Clean and Build won't work for you. You should however try it at least once to see if fixes things.
If it does fix your problem but doesn't last you'll need to do one of two things.
Clean just the one file
Delete the offending temp file. You probably won't be able to do this because with VS running since it may have a lock on the DLL. You may also have to stop IIS. You can use Process Explorer to look for the processes that have a lock.
Use a custom solution
Its unlikely that you're going to be modifing all 320 projects at the same time. Create a custom solution for just the projects you're working on. You'll still be able to step through any project you have the DLL and PDB for if you need to.
Which to do
Using a custom solution has its problems since you can no longer use project reference for projects not in your solution. This impacts your team's source control. You'll also have to make sure the DLL's and PDB's from outside your solution are in a stable location and you'll need a way to detect when thoes other projects have changes that you care about.
These problems can be overcome with a careful check-in process for Project changes and scripts that copy files and working with team members to figure out how to communicate changes.
On the other hand closing VS for every change or running Clean and build isn't really tennable either.
it may be a workaround, but I just need to see if it will work or not, then we may investigate more in the original case. but for now, try this:
1- publish this website to a different folder
2- open the newly published version from your preferred browser (ex: http://localhost/APP_NAME).
3- from VS, open "Debug" menu, choose "Attach to process..."
4- select the IIS worker process "w3wp.exe" and click "Attach".
(if you can't find it, make sure that the checkbox "show processes in all sessions" is checked)
5- start debugging your source code normally and let me know what happened, thanks.

Resources