I'm writing an ASP.NET web service, in C#. Before yesterday if I wanted to debug it I would just press F5, and ASP.NET Development Server would start hosting my service. Breakpoints would be enabled and would work. Recently this functionality is gone. Now when I start debugging, Development Server is started but the old version of my web service is hosted, and breakpoints do not work. I get a warning that versions do not match.
It does not help if I rebuild everything, or change the assembly version, or even change the file name of the DLL. It does not help if I delete the whole temp folder %TEMP%\Temporary ASP.NET Files. Old web service will be pulled out from who knows where, and stored in temp folder again.
Major change before yesterday was that I had installed IIS. Web service that is installed there works as expected, but I need to debug it as well. I thought that the problem is that I installed the web service (with vdproj), so I uninstalled it, but this did not help either.
How to prevent the system from caching the old version of web service. Where is this old version stored anyway?
Check the Web settings on your ASP.NET project. To get back to using the ASP.NET Development Server for F5 debugging make sure the "Use Visual Studio Development Server" radio button is selected under the Server heading. I also specify a specific port so other projects in my solution can consistently reference it (in my case I'm dealing with a web service). There's a good chance that you will find the "User Local IIS Web server" radio button selected.
Hope that helps.
EDIT: The problem here is not about IIS, but about changing the target build output folder of web service. It must be bin\, or Development Server cannot find it. Rebuild did not help because it would change dll file in new folder, but old file would remain undisturbed in bin folder.
Related
I'm trying to deploy an ASP.NET application to localhost using IIS, I've been reading a LOT of tutorials and following them step by step but I just can't seem to make it work...
I created an Application Pool(TestPool) with .NET version 4.0 and gave it every permission to the folder where the application is at.
I then added an application to the Default Web Site and tried to run it at
http://localhost/TestApplication/
But I keep getting:
Any idea what is wrong and how can I solve this?
Versions:
IIS version: 6.2
OS: Windows 8.1
VS 2013 Ultimate: 12.0
VS .NET: 4.6
PS: It's my first attempt at deploying an ASP.NET application so if you need any further information just leave a comment.
EDIT:
It is now running at least thanks to Julian and Marge, but when I run it using VS it has the default view, why isn't it showing when I run it through IIS? When running through IIS it just lists the files:
This error is because your website, in the IIS Server, does not have the Directory Browsing enabled and the default document (default page of the site ex: Default.aspx) configured.
Go to IIS Server IIS > Default Documents and check if the default page of your site is listed, if no, add the page.
Check the related link:
https://support.microsoft.com/en-us/kb/942062
Generally speaking, you do not need to access IIS manager at all to run your webpage on localhost. All what you need to do is right click on the project and then choose properties. In the Web tab you will find Servers section. Make sure the Project Url is something like http://localhost/myproj or simply http://localhost/ then hit Create Virtual Directory. Your webpage should be up by then, and you can access it either in debug mode, or simply by navigating your browser to the Project Url you have chosen.
When you add web application in IIS ex.
That your hostname should be to add in host file which is C:\Windows\System32\drivers\etc"\hosts
ex.
127.0.0.1 test.pln
I've been new to silverlight applications and trying to figure out this issue for past few days.
I tried creation a silverlight application in VS 2012, there are two separate projects created,
With Xaml files where the actual content exists
The .Web project where the .xap file is created.
When I tried running this through VS with breakpoints in the first project through IE the breakpoints were connected quite well.
When I tried hosting this project on IIS and tried running it on IE, it worked. (I hosted the .Web project only)
While I tried browsing the silverlight app from IIS and attached the process to IE with type silverlight,x86 in VS with those breakpoints in project 1, I was unable to hit them.
Please help me to debug my silverlight app when I try to browse it from IIS.
I tried everything I could think of so far. A hint would really be helpful.
Thank you.
Phew, finally this is fixed. Everything was precisely as it was supposed to be, I just missed out on the flow that was necessary. Below is the approach to debug silverlight app through IIS
Create a new silverlight app in vs
build it and create a new website in iis
in website add the silverlight.web project
add breakpoints in silverlight app from the same path as hosted in iis
browse the aspx page of .web from iis
click on attach to process (while the aspx page in running in IE) and search for iexplorer with type silverlight,x86 and click attach. (Make sure you're running VS in admin mode).
Refresh the IE page, and voila you have what you want.
I am using visual studio 2010 on .net4.0 for my projects and I've found that each time I do a change in my project, I build and run but I cannot see my changes. I've found this happening once or twice mostly with my web service projects. I'm no pro with web services and am encountering this problem for the first time so would be grateful to anybody who can tell me what has gone wrong with my project and how to fix it.
Edit
My asmx file is where I have added an additional method but am not able to see it when I run F5
When you change the compiled code in a web service or site, you need to make sure you restart the web server hosting that service or site.
You are probably using the ASP.Net Development Server. Although Visual Studio starts this server for you, it does not restart it automatically when you rebuild. As a result, the server will still be referencing the previous version of the assembly that you changed.
In the Windows system tray you should see one or more icons depicting a web page with a purple gear overlapping it at the bottom-left.
There are three of them in this example:
You can stop the server by right-clicking its icon and selecting "Stop". (If you have more than one, you will learn to identify the one you need to stop by recognizing the port number shown in the tooltip when you hover the mouse over the icon.) Visual Studio will restart it when needed.
When you're making changes to a service or site, use this workflow:
Make code changes
Stop the ASP.Net Development Server
Rebuild the project containing the changes
Run
Client-side code vs. Server-side code
If you're changing client-side code (HTML or JavaScript), then you may need to force your web browser to refresh its cache. In Windows this is normally done by pressing CTRL+F5 in the browser (see refreshyourcache.com/en/cache for more info). If you're changing compiled code (C#), and restarting the server doesn't help, try restarting Visual Studio, then do Build -> Clean Solution, then Rebuild.
If you are facing issues in ASP.Net Development Server, I think you are better off creating a virtual directory in IIS and host your web service there. That way you should be able to make your changes, just build it (don't run it) and that should be available on your virtual directory and you just browse to webservice. Then you don't have to hit F5 again and again and don't have to worry about instances of ASP.NET dev server.
Following article contains good step-by-step instructions on how you do it on IIS 7.0. This article is about hosting a website - however, hosting a webservice is not different.
http://www.codeproject.com/Articles/28693/Deploying-ASP-NET-Websites-on-IIS-7-0
I need to deploy a asmx web service to a server. I can run the service locally and it runs fine but where is the asmx file kept? In my project folder I can only see the solution file. This is my first time dealing with web services so forgive me if this is a stupid question. The service is written in C# if that makes a difference.
On your project, select Build Menu -> Publish. There are many publish method, but for simple way, you can choose File System. Define Your Target Location and click Publish. When it's Done, go to your Target Location using Windows Explorer and you will get all file that need to move to your IIS server virtual directory.
I'm building application using WCF RIA services and silverlight running on azure dev fabric. I have a solution with silverlight client projects, a Web client project and WCF projects. I placed breakpoints in silverlight project and WCF project (in app.xaml.cs) so I can step thru the code on both side. I break in my WCF code but I can’t jump in the silverlight code. When I looked at the silverlight breakpoint while debugging, the red dot displays an exclamation mark and this message: "The breakpoint will not currently be hit".
I’ve done several things to solve this:
Made sure that the ClientBin folder contains the correct .xap file.
The folder contains the correct xap.
Checked the solution if it was in release mode, but apparently I was
in Debug mode
Checked if silverlight debugging is enabled in web site, yes it was
enabled. I’m able to debug the silverlight running on separate
instance (not in azure).
Deleted bin/debug and or bin/obj folder but still no good
Deleted the ClientBin folder on silverlight's web role end
point
Deleted the source codes and then retrieve them again from source
control to check if there’s change in source control, still no good.
Apparently the solution in other developer’s workstation works fine, I’m
the only one having this problem.
Reset the iis using iisreset, still nothing good happened
Cleared the browser's cache (I’m using IE9), nothing good
happened.
Anyone ever met this situation? Any answer other than re-installing would be appreciated.
I tried to reproduce this case on new solution with new azure, silverlight and wcf project and everything works fine. There was no problem in debugging either silverlight or wcf project.
Thus, there is nothing wrong with my VS or browser setting.
I tried to use a copy of the other developer's solution and there's no trouble in debugging. I have no idea why such thing could happens because the solution is basically the same (All of the csproj.user and suo files are not checked in to source control.)
Go to your Solution >> Properties >> Set the silverlight project as the startup project.