Edit and Continue for web application - asp.net

I check edit and continue in Web application properties, still have to stop the debugger!!, re-attach to the project.
If Web application cannot be edited while debugger is attached is there an easy way to convert it to web site, given that the application is on live server, and I am newly introduced to it.
What do u think?
Thanks

Apparently you just need to 'pause' the debugger rather than stop it: https://stackoverflow.com/a/10838410/2034089

edit and continue for me worked just in forms, console etc applications

Related

when I click on Browse &;80(http) i got this screen

when I clicked on Browse *;80(http) I got this screen in IIS..what could wrong? please give me solution.
Try installing the ASP.Net Frameworks.
Also check whether you have configured web config file in a proper manner.
All frameworks are very important as far as the configuration goes.
Hope this helps!!
The issue you are running into is a common problem for developers since they start developing on their Desktop or their Documents folder without realizing that only they have access to them. In other words those folders only have ACL's for you. This works ok when you use Visual Studio since they run the process as your identity which makes it all work, however when you use a real server, such as IIS that runs as a service it will no longer run the process as your identity but some service account which will NOT have access to your directory.
You will need to add ACLs for IIS to be able to read the files (IIS_IUSRS or the AppPool Identity like IIS APPPOOL\DefaultAppPool, depending on the settings of your apppool), or move it to a folder that has enough access such as \inetpub\wwwroot\

How to debug a deployed web site

This question kind of follows on froma previous one I posted.
I have a .net web site deployed on a server.
In certain circumstances the site falls over. Specifically, when I browse to the site from my PC (which has visual studio) to the web server using a particular dns entry.
So, I want to debug a browser session on my PC which is looking to a URL on a web server.
How can I do this?
Within VS when I attach to Internet Explorer no break point is ever reached?
Thanks in advance.
Jim
Attaching to Internet Explorer isn't going to help you because the web site doesn't "run" inside IE. You need to attach to the IIS process on the web server to see what's going on.
May I suggest you start by having a look through the basics of production debugging on Tess's blog. I think this would be a great place to start for you.
Sussed it... attach to w3wp.exe on the remote server.
Made easier for me because the app I'm debugging is in its own IIS App Pool so I could see (by the user name) which one of the w3wp.exe to attach to.
Works like a dream!

How to attach browser and my web Application

Dear All,
I am working on the Web application, at time of run the my application open login page but browser disconnect from my application. So I am not able to debug the code.
Please help how to stop this disconnectivity between browser and my web application.
Assuming you are using Visual Studio then all you need to do is put a breakpoint in a method that you know is going to be hit in order to debug the code i.e. your login forms page_load method.
A more fundamental point is that the client/web server model is stateless and that there will be no connection between your browser and the server between requests.
Ok, a few answers here depending on what you are doing. If you are using the built in web server in Visual Studio you simply have to set break points within your code. If on the other hand you are using IIS and Visual Studio in combination then all you need to do is set a break oint in your code and attach Visual Studio to the relevant w3svc worker process, if in doubt select them all.
It's something I do virtually every day and it works very well indeed.
simes

Why are the Global.asax events not firing in my ASP .NET website?

I've been developing an ASP .NET 3.5 web application against Cassini, the built-in web development server, rather than against IIS.
In my Global.asax file, in the Application_Start event handler, I have some code which logs the fact that the website has started up. This all works fine with Cassini.
Since deploying the site to a virtual directory on a test server using IIS6, I am finding there are no log entries being written, and so I'm concluding that the Application_Start handler is not firing.
I then tried removing the virtual directory and running the site directly out of the root of the website on the test server, but it didn't make any difference - still no log entry for application start.
I know these events should fire irrespective of my deployment environment, has anyone got any ideas what is going wrong here?
I had a similar problem and I was wrestling with it for several days.
The initial problem was something else - cookies not being set in Application's EndRequest handler.
Finally I somehow managed to realize, that the problem actually was that the event is not being fired at all.
It took some time to find that out, because all was working fine on my machine.
But on the production server - quiet as a tomb.
I am only writing this, because I really hope to save from troubles at least one person.
The real reason for the problem was a missing global.asax file on the production server.
The global.asax file was present on my computer, because the development environment is located there.
I had prepared a deployment bat file, which coppies files from the development folder, removes the unnecessary ones and makes a package.
Well - the global.asax file was marked for deletion in that script.
After starting to deploy it all the problems went away.
I hope I helped.
If you make a request to your app does the "Application_Start" fire then? I don't believe it will be started until the first request is made.
How are you logging? Is it possible that your logging component is not correctly set up? For a quick test try throwing an exception inside Application_Start and that will tell you quickly whether or not the event is being raised.
In your deployed enviroment, what is the thing you're calling? The reason I ask is because if you're calling a WCF based web service (ending in .svc), then Applicaiton_Start will not fire as the call to WCF isn't going through the ASP.NET pipeline. This wouldn't necessarily rear it's head w/ Cassini.
You may be getting a runtime exception that is occurring before your .NET code even gets a chance to run. If you look under the Event Viewer's Application logs, you may see some warnings or errors that will clue you in to what is happening.
When you develop in Cassini you are running the application under the user's account- probably administrator. Once you've deployed to IIS, you are (hopefully) running under a lower privilidge account.
This lack of appropriate permissions is probably the reason why your application is not working correctly- I would check the security settings to write to the log (presumably you are writing to a log file?).
1) iisreset /stop
2) push the published code to iis virtual directory's physical folder.
3) iisreset /start
4) make web request
Still not sure after this. the do a Thread.Sleep(60000); and attach with remote debugger to the process w3wp.exe imagename.
There may be more than one process of that name but this one is managed code also doesn't hurt to attach to multiple. Set the break point after the sleep. After the one minute sleep step through.
I thought I had a similar problem, working on some old projects, I was under the impression that the global.asax was not running because the code would first go into building my authentication controller which would fail because of class not registered (that part happens in the global.asax).
Turned out it was due to a config item. When I moved the AuthenticationModule declaration into handler section in web config, it worked fine with IIS express.
Basically, because of a config item, another piece of code was being executed before global.asax, making me believe that it would not be called.
We tried a lot of things.
global.asax works on local computer but not after i publish to server
Global.asax is not publishing and event are not firing in Global.asax
Global.asax not firing for Release build
Mystery of Global.asax in ASP.NET MVC application
We also tried putting the below files in root and bin directories.
App_global.asax.dll and App_global.asax.compiled files
PrecompiledApp.config
None of it worked!
We had to put raw Global.asax instead of pre-compiled dll, in order to fire the global events, for our asp .net 2.0 website.
Hope this helps someone! Cheers! Happy coding! :D
My fix was an odd one. On my development machine I am using localhost and I changed the port number it used - and then it worked.
also in IIS Manager turn on Dot Net debugging. It's under "Compilation"
If a required dll is missing from the bin directory (for example there could be a 3rd party dll which has been used in your latest build, but accidently excluded from deployment), then the Application_Start will not fire.
My issue was resolved by adding the below compiled files in the bin folder.
App_global.asax.compiled
App_global.asax.dll

Disable ASP.NET balloon popup

Is there a way to disable that annoying balloon notification that pops up when you start an asp.net application? Here's a picture of what I'm talking about:
http://i41.tinypic.com/2prd3b7.png
I looked through the VS and built-in server settings and don't see anyway to disable it so I don't believe it is possible. You could disable ALL balloon tips instead.
Use IIS to run/debug your applications instead?
You could go look through the Cassini source code and see what triggers that (the "ASP.NET Development Server" in VS is still based on the old Cassini web server).
Besides, I wouldn't stop the popup, because you may need to note the port number sometime.

Resources