Unable to copy file, Access to the path is denied again and again and again - asp.net-mvc

I kept having this annoying thing stop me from building my project over and over again even though I searched for years on stackoverflow trying to find solution but none of those I tried works. The problem just kept coming back!
The file having problem is system.web.mvc.xml, wont let me delete even I am the administrator.
Im running MVC 5 projects.
tried to close vs 2012 first then delete files : fine for the next build but then it came back after 1 or 2 builds
tried to un-check read-only option to my entire project folder : fine for the next try but , you know.
tried to close and re-open : same as above
tried to run administrator : same as above
So anyone have really get rid of this? like ever?

Same with me..
Finally I did this trick and work for me:
Close The Solution - Close Visual Studio. And Reopen Visual Studio and solution
Copy System.Web.Mvc.dll from bin folder to new fresh empty folder, I make Lib folder under solution.
Remove read only at the dll
Remove System.Web.Mvc from project reference
Re-add System.Web.Mvc.dll (the dll copied at Lib folder)
__
Hope This Help
Regards

Related

Visual Studio won't show added files in the solution explorer

Why would VS2019 (with VisualGdb) refuse to show added files the solution explorer?
I found some workaround, i will post as an answer. But i'm still quite interested in the explanation of the underlying problem.
Additional info: opening the project file (.vcxproj) shows that the files are actually added to the project, only they are "invisible" in the project explorer.
I'm not sure, if this issue is VS-related or VisualGDB-related, or even layer-8-related, but hopefully this answer will help some people anyway.
So after trying many things not leading to success, i found this workaround:
In the project file (.vcxproj), i actually found entries for theses "invisible" files, and after deleting them and re-opening VS, i added these files again in the soluton explorer. Only this time, they correctly showed up in the solution explorer.
Weird: a compare tool showed not the slightest change in the project file, so there got to be some underlying issue.

Can't get rid of old folder in application bundle

Seems to be similar to this question:
Xcode won't let go a resource file
But for Xamarin. I have a xamarin solution I'm working on in Visual Studio for iOS. I added some resources in one place and then later decided to move them somewhere else. But when I build the project and look at the application bundle on our build Mac the originals are still there. Even though I scrubbed every instance of them from my Windows machine it somehow still ending up in the application bundle!
How do I complete scrub any cached traces? I've reset the simulator, cleaned and rebuilt from visual studio, even deleted the bin and obj but I can't get rid of the damn things.
I had a similar problem with files I've deleted from VS still being included in the bundle when running the app.
I followed the output from The Mac Server log and you can see from there where the files are being copied from, in my case
/Library/Caches/Xamarin/mtbs/builds/[App_Name]
Delete your application folder in that cache and it will fix the issues.

Not able to open files in visual studio after debugging application

I'm working on an ASP.net mvc project in Visual Studio 2012. Came across this issue, which is incredibly annoying when debugging my application. Say that I have n number of files open in my editor whenever I build and start a debug-session using F5. Ok, so the editor closes all the open documents as usual, and I do my debuggig tasks. Now; when I stop debugging and want to re-open the files that I had open earlier, I'm not allowed to do so. Nothing whatsoever happens when I click these files, until I restart VS2012.
If I close all of my open documents before debugging, opening them after works fine and the way it's supposed to. Also, this is the case for all of my new or existing projects. I run with ReSharper 7.1.2 installed.
Has anyone encountered this issue before?
To stop ALL files from being closed after debugging simply go to
Tools > Import and Export Settings > Reset Settings
This will fix this bug, I have the old settings saved that caused this error but I am unsure what specifically causes it within the settings. After frustratingly searching around for a clear answer to this problem I hope this helps others that might have this issue.
Note, I also had your error in my instance of VS 2012 but had neither of your extensions. I would propose that uninstalling your extension removed the setting causing the error.
Did you tried cleaning the solution?
Go to Build then click Clean solution
After a bit of trial and error, I found that AnkhSVN was causing the problem.
Whenever I tried to check in (or out) the code, it caused some exception.
I have no clue, why this prohibited me from opening files after debug but it works after removing AnkhSVN.
I've got this issue as well. I wasn't able to solve it. In my case, the file was open but it was invisible. After debugging again with the file still open but "invisible" I got an error that the file doesn't exist when I navigated to the page (I faced this issue while working on an ASP.NET project).
I recommend reinstalling VS, in case you've messed with all the debugging and window settings.

error occurrance while validating HRESULT = '80004005'

i have created a windows service in visual studio c#.net ,and i am trying to create a set up and deployment for the service, when i am buiding the windows service project ,it is successful
i have added the Project Output Group as Primary Output with windows service project.
i have also added the custom action to the set up project,
when i try to build the set up project it displays"An error occurred while validating. HRESULT = '80004005'" i also noted there is nothing in the detected dependencies folder.
I had the error code 8000000A, so it might be different, and I'm not sure if this is any help for your problem. But re-adding references did not work for me. However, what worked for me was removing the .suo file (next to the .sln) and (re)building again.
(It might have been caused by accidentally opening a Visual Studio 2010 class library in a Visual Studio 2008 comapct project. I am not even going to try reproducing this!)
Removing the .suo will make you 'loose' your open files (and maybe some other settings?), but IMHO that's just a small sacrifice(?).
I just hope this will save someone some time...
I've just had exactly the same issue with a WinForms project. I had several projects in my solution, they would all build without an issue except for the set up project.
I overcame this by removing all the references to the other projects in the solution in the main project (the one that was being set as primary output) and then re-adding them again by going to add reference >> project. Once I had re-added the references to the other projects in the solution, the project dependencies re-appeared and all built fine.
Hope that helps
Richard

Why am I getting a different xml file open behaviour depending or where I open the sln file?

Ok, I know that question is not very informative.. Someome feel free to change it after I explain:
My asp.net mvc project is stored in a folder in my desktop. When I double click on the sln or csproj to open the project and then hit the Start Debuggin button it all works fine.
But, when I go to start, programs and open Visual Web developer and from the Recent Projects I open the same project and Start debugging I get a read file error (could not find part of the path in C:\Program files(x86)\Microsoft Visual.......")
Its in this line of code btw.
this.nav = XElement.Load("App_Data/myfile.xml");
It obviously is looking on the wrong directory cause the project folder is in my desktop. Keep in mind that it works just fine if I access the project by just double clicking on the csproj file.
Thanks in advance.
You can't rely on the working folder for the process in ASP.NET applications. You should be resolving a relative path in code:-
this.nav = XElement.Load(HttpContext.Current.Server.MapPath("App_Data/myfile.xml"));
However introducing the HttpContext object can damage the testability of your code, if this in controller code.

Resources