UTF-8 solution file save unexpected - asp.net

I am developing a webpage and every time I hit save all it brings up this save dialog. It has does this every time and I have rebuilt this page three times trying to get it to stop. What is causing it and how can I correct this unexpected event.

This typically occurs when opening the visual studio project as a web application or web site that never had the solution file created. By default the visual studio wants to have a solution file with it. Until you click "save" it will keep bothering you. Once you tell it "save" it will not bother you anymore and there is no harm in have the project associated to a solution file.

Related

Breakpoint is not hitting ascx.vb page when attached to w3wp.exe process

I am currently trying to debug an ascx.vb page and the breakpoint is not hitting the page.
I am getting this error "The breakpoint will not currently be hit. No symbols have been loaded for this document".
I have been using this project for 2 months and never encountered this error before. I just did a small change on add button save it on chrome could see the change however, when i am debugging getting this issue for the first time.
Steps done:
Attach the breakpoint to the ascx.vb page
click on debug then attach to process as below (highlighted in yellow) :
checks already done:
Project is being run on debug mode
when debugging the symbols are not loaded.. have check Debug windows modules and is as below:
I have tried loading some symbols which created a folder symbolscache but still the debug point did not hit the page.
Is there something wrong in browser/iis or VS.
I was using VS 2017 but the same issue is occurring on VS 2019 professional.
Any help will be highly appreciated.
Thanks.
You can try to disable the "Just My Code" option in the Debug/General settings.
or
Right click the Solution in solution explorer, click "clean solution", this deletes all the compiled and temporary files associated with a solution. do a rebuild of the solution and try to debug again.

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

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.

Visual Studio is opening web page in notepad

I was working on webpage (Chat.aspx) accidently my system got shutdown. Now my visual studio opening webpage in notepad which is empty(showing nothing).
I also tried it to open with in Html editor, it also showing that file cannot be opened in selected editor please choose another editor.
How can i recover my work/code?
Once I faced the same issue , I researched a lot on internet but in the end I ended up with writing the page again. Basically File pointer in Memory becomes invalid or corrupted due to which OS can not open the file in VS. here is a link for you
When I faced this problem one of the expert suggested me that it is not possible to get back your page .
If you have backup of your page then use that.
I recently faced this issue working in VS 2010 and I was breaking my brain. Luckily I had source control, so to solve the issue I manually deleted it the file and got latest version.

"Advanced" Edit and Continue?

Alright, I've been searching forever and can't find the answer to this.
So on my work computer I run Windows 7 and Visual Studio 2005. I have a ASP.NET project (2.0) and let's say I hit F5 and start debugging. Now, once a page is done rendering I can edit the content or the codebehind code of the page without it throwing any error messages (just like if the project was stopped). Then if I save the file and hit refresh on the current debugging browser, it'll take a minute to recompile the project automatically and then refresh with the recompiled code. I can ONLY change the code in the ASP.NET project, not any class libraries that the ASP.NET project is dependent upon. I can also set breakpoints and it'll hit them (so it's not like the debugger is not attached or something).
Now on my home computer, I run Windows 7 and Visual Studio 2010. I have an ASP.NET project (4.0) and let's say I hit F5 and start debugging. Now, it doesn't matter if the page it done rendering or not - I cannot change ANY of the code behind, although I can change the content. If I attempt to I get a message saying
"Changes are not allowed while code is running or if the option 'Break all processes when one process breaks' is disabled. The options can be enabled in Tools, Options, Debugging."
That being said, if I put a break point, refresh the page and hit the breakpoint THEN I can change the code and then hit F5 to continue.
So my question is - what EXACTLY do I need to do to get it to work like my work computer? It's REALLY annoying to have to stop the project or be clicking breakpoints all over to edit one little piece of code (especially when I'm so used to not having to do that at work). Is this some change in Visual Studio 2010 or something? From what I've read, how it's working at home is the real "Edit and Continue", but I can't figure out what to call it on how it works with my work pc.
Another difference (might be of help):
I set it up so that my IIS goes to the project folder, and then run the project outside of the debugger on both my work and home machines.
Now on my work machine I can make a change to the code and when I hit refresh on the non-debugged browser it'll do the same pause for recompile and then refresh the screen.
On my home machine if I make a change to the code and save it and then refresh the non-debugged browser it will not recompile the code.
So this makes me think it's some IIS setting in the end to make it auto-recompile? It clearly doesn't seem to have anything to do with VS since I'm not even going through the VS debugger to access to code at that point.
Just my thoughts: maybe you use on the work WebSite project, but at home WebApplication. In case of application all code will be compiled in the single DLL and changes should be recompiled first. In case of WebSite - each page compiles in different DLL and you can chage any of the page and it will recompile it.

Visual Studio ASP.NET MVC Save Solution Session End?

Every now and then when I am running/debugging an ASP.NET MVC website through Visual Studio and if I am changing some CSS or HTML in a View while the project is still running, the Session will drop intermittently.
I have confirmed this in the Global.asax adding a Session_End method and setting a break point inside it. As soon as I click Save All through Visual Studio after about 10 or so minutes Session_End is called. I don't even have to refresh the actual page which I think is a little bizarre...
I realize that recompiling the app would cause the session to be lost, but I would not think modifying a View while the application is running would cause this.
Any thoughts on why this could possibly be happening?
Since you are clicking Save All, is it possible that you've also modified a code file or the web.config as well. Any sort of change -- even if you removed it -- would make the file dirty and cause it to be saved as well. This may cause the behavior you are talking about.
You might want to think about using SQL for session state in your development environment. I recently switched to this (because I needed to for our production environment) and no longer see that sort of behavior even when I stop debugging and recompile the application. As long as the session cookie is still valid, it is able to pull my session information from the database.

Resources