Asp.net debugging issues

Source: Internet
Author: User
Tags http redirect net command tmp file windows 5 visual studio installer

It took a whole day from yesterday to today and almost collapsed everyone! In the future, we can no longer shut down the server. Due to this general idea, almost all the Net installation and debugging problems have been encountered by me. Fortunately, I recorded them one by one. At the same time, I have found some related solutions in CSDN, so I am afraid to enjoy them exclusively for mutual learning and communication.

The reason is that the machine runs IE in a false state. If I am not happy with it, I will not talk about hot start, and the result will be an accident.

When I re-opened the project being implemented in Vs2003.Net, I did not respond for a long time, and the machine became abnormal and slow. Of course, due to the occupation sensitivity, I immediately came up with Ctrl + Alt + Del, which is not good, CPU usage of 100%, always high, run IE, no response for half a day. First, is it a trick?

Speed is the highest, shut down and restart, immediately open the genuine anti-virus software KV2006, kill again, nearly two hours of suffering, my machine ice qingyu Jie, no shadow of a cancer (absolutely no hair, I am a five-year-old man )! What will happen at first? Press Ctrl + Del + Alt again and check the task manager to see if the "alien" hacker has been raped! (Many articles say that win2000 only has two of these things, and I walked out of three.) I closed the win2000, and shut down the CPU or 100% CPU and processes one by one, the results are the same. ---- This is the first possibility: the possibility of employee recruitment is ruled out!


Since there was no prompt at the beginning, but the CPU was suffering, but it was normal to enable vs2003. I tried to open other projects! Is there a problem with my program? Let's not talk about it. Let's get the backup program from yesterday (this is normal), rename the current source file, and perform the backup (I often do this and there was no error in the past ), restart and open the project. The problem persists .... Second possibility: the possibility of program problems is also ruled out!


Is it so tortured? I posted an instruction post on CSDN, but I couldn't get a good solution. Never wait!

Some netizens said they had used a proxy to access the Internet, which caused this problem. I have never used a proxy to access the Internet! Some netizens said that it was not a CPU resource problem caused by some BT and the like. If I did not say anything, I would deny it. I never used the BT plug-ins or the like. What would happen at first? Another user posted a post asking me to shut down the SMTP virtual server and start it again. I tried it according to his method! What about creating a project ?? I didn't expect this method at the moment. I could just create a new project and reference the original code! There was a flash of thought in my mind, opening Vs2003.Net, creating a project, KAO, finished, no movement, and dead. I read Ctrl + Alt + Del again, CPU100 % didn't have to say, a straight line is continuously crossed in front of my eyes ......

I began to wonder if IIS was playing a strange role ?? I found that the original project cannot be opened under IIS, And the CPU usage is 100%! It's all about death. If you don't want to do anything about it, you just need to know it. As a result, I restarted the machine and deleted the virtual directory automatically corresponding to IIS when I created the project. At the same time, I created a new project with different names, and then I encountered a new problem:
Unable to find the script Library:/aspnet_client/system-web/v1.14322/webuivalidation. js

This problem is not difficult to solve:
The method is:
Click Start → run: c: \ winnt \ microsoft.net \ framework \ v1.14322 \ aspnet-regiis-c
OK

This problem has been solved, and I think I should name the current project as the original project name, so that I can rereference the original code and solve it! Let's talk nonsense, let's talk about the action-the result! No! It is restored to the original CPU 100%.

Depressed, it's a bit boring! Shut down, restart for 48th times, And I open VsNet2003 again. In despair, it's all dead. I want to see the dead first. I will open this project and wait for his CPU to run, what is the final result! Snail like running (the status bar contains "text prompts such as opening a web server )... After about 30 minutes (the tea I have made has two drinks), a dialog box is displayed:

Visual Studio cannot create or open an application because the computer does not run a web server. Please start the Web server before proceeding to the next step.

This is just a fart, and my IIS is obviously open! When CPU usage reaches, I try again, re-open IIS, and restart IIS. At the same time, on another machine with hundreds of degrees of related information, some people say they want to set the access permission for the wwwroot folder to everyone, which does not play a role, because my folder is shared (of course, the problem may be different ). The method is:
Permission issues. asp.net users may not have write operations on wwwroot.
Solution: try:
Control Panel -- Administrative Tools -- Computer Management -- local users and groups
Then add the aspnet user to the Administrator group.

After such a torment, I simply restarted the host again to see what new adverse reactions were in VS2003.Net.
New error message.

The main directory of the default IIS website; local path

Set it to "C: \ Inetpub \ wwwroot ". On the LAN, the client can use "http: // localhost/Mydir/index. aspx" for access. To facilitate client access

Select the main directory of the website and set the local path to "C: \ Inetpub \ wwwroot \ Mydir ". In this case, the client can use "http: // localhost/index. aspx" for access. However

When you open this project (MyWeb) in the development environment of VS. NET 2003, the following problem occurs:

The project file cannot be obtained from the Web server. The Web project "MyWeb" cannot be opened ". File Path "C: \ Inetpub \ wwwroot \ Mydir" and URL

"Http: // localhost/Mydir" does not match. The two must be mapped to the same server location.

HTTP Error 404: Not Found

There are two options:

What do you want to do:
1. Try again using different folder sharing paths
2. Try to open the project through FrontPage Server Extension

I think this problem should be caused by a virtual path. I opened IIS and found the default site path C: \ Inetpub \ wwwroot \, at the same time, the path of my project is correct. I accidentally found that CPU accounts for no more than 100%. It seems that the original problem was solved, but the new problem came out again, that is, there was no discount. First, the CSDN community saw no similar problems. Fortunately, A lot of methods;

Method 1. go to IIS> default website> right-click "properties"> Directory Security> authentication and access control> Edit> change your Anonymous Logon account to Administrator and enter the password.

I tried this. It's useless.

Method 2: reinstall IIS
Open the Windows component wizard.
Click application server in components, and then click details ".
In the "Application Server" dialog box, under "Application Server sub-components", click "Internet Information Service (IIS)", and then click "details ".
In the "Internet Information Service (IIS)" dialog box, "Internet Information Service (IIS) sub-component", perform any of the following operations:
To add an optional component, select the check box next to the component to be installed.
To delete an optional component, clear the check boxes next to the component to be deleted.
Click OK until you return to the Windows component wizard ".
Click "Next", and then click "finish ".

I will keep it for use.

Method 3: Select "file" menu --> "open a project on the Web", find the disk of the project (such as e: \ webfile), and open the file with the extension. vbproj (cs projects are similar ). note: Do not open. sln.
Then you can regenerate the solution.
I tried this, and it seems that it does not work, because the new project cannot be created, and the original project cannot be opened.

I used this method to solve the problem.
Method 4:
A: 1. Open the IIS manager.

2. Right-click "Default Web Site" and select Properties.

3. Click "Http Header ".

4. Click "MIME Types ".

5. Click "New ".

6. In Extension, enter ". tmp". (No quotation marks are required)

7. In MIME Type, enter "Temp". (No quotation marks are required)


Alas, after a long time, I finally got it! In. some errors in net2003 are beyond our imagination. In order to make everyone have some tricks in the face of these problems, I found some common problems by the way, and the dismissal is helpful to everyone.

Problem 1: you cannot create a web application.
Source: http://dev.csdn.net/develop/article/19/19725.shtm

1. When no application is created in the site home directory:

Follow these steps to create a WEBAPP through FP extension + virtual directory:

(1) Right-click the site-all tasks-configure Server Extension

(2) create a virtual directory *** and configure the application

(3) create a WEB project in VS with the name ***

(4) Establish WEB through FP Extension

 

2. When the site home directory creates an application:

Method 1-FP extension:

(1) Right-click the site-all tasks-configure Server Extension

(2) create a WEB project in VS and set the name as needed.

(3) Establish WEB through FP Extension

Method 2-WEB Sharing:

(1) Change the IP address in IIS to all unallocated

(2) Change the address to 127.0.0.1 or LOCALHOST.

 

3. Try the following methods when you cannot create one:

(1) "Site" --- Right-click --- "properties" --- "all tasks" --- "re-calculate the hyperlink on the Web"

Then, use the frontpage Server Extension in vs.net to create



(2) indicates that you want to directly access project files on the Web server through file sharing; you do not need to install FrontPage Server Extensions on this server.

When Visual Studio. NET is installed, a "VS Developers" (VS Developers) User Group is created, and the user group is granted read/write permissions on the inetpub \ wwwroot folder. Anyone who wants to create a Web project using file sharing on a computer must add it to the VS Developers user group. The newly created VS Developers group does not have any members. Therefore, even users who install Visual Studio must manually add themselves to the group.

If you do not want to install Visual Studio on the server, you can install only the server components through the Visual Studio installer to create a "VS Developers" (VS Developers) group.

(3) win2003:

In VS. NET, to test the URL and UNC, VS. NET generates a. tmp file under the Directory and sends a request to the file through HTTP. However, in IIS 6, for security reasons, the tmp file is not registered. By default, it is blocked and an HTTP 404 error is generated.

To solve this problem, see the following method:

1. Open the IIS manager.

2. Right-click "Default Web Site" and select Properties.

3. Click "Http Header ".

4. Click "MIME Types ".

5. Click "New ".

6. In Extension, enter ". tmp". (No quotation marks are required)

7. In MIME Type, enter "Temp". (No quotation marks are required)

Another solution is to use the following command line:

% Systemdrive % \ inetpub \ adminscripts \ adsutil. vbs set w3svc/1/root/MimeMap. tmp, temp

When creating a Web Application, VS. Net needs to create a temporary file named. tmp under the Creation Path.
After VS. Net creates a project, it will seek the project file from the Web Folder through HTTP and temporary files. Because IIS does not set the. tmp file to the MIME type in some installation steps of windows2003, IIS returns an unknown file type error to VS. Net, that is, the file cannot be found. So VS. Net thinks that your IIS path settings are incorrect.


Problem 2: The aspx project cannot be debugged.
Causes and Solutions
1. One debugging process has been started (two projects have been opened at the same time, and one has been debugged): Only one can be started at the same time;
2. Change debug = "false" to true in the configuration file;
3. No application is created in the virtual directory (or the name is blank): click "application" in the virtual directory attribute to create
4. Set project configuration to Release: click "generate"-configure, and select "debug"
5. "You do not have the permission to debug the server": Modify the Security Settings of IE and "automatically log on with the current user name and password"


Problem 3: The Automation server cannot create objects.

Causes and Solutions
1.: Modify the Registry ([HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ CLSID \ {0D43FE01-F093-11CF-8940-00A0C9054228} \ ProgID]
@ = "Scripting. FileSystemObject"). Change FileSystemObject to any name.

2. Run Regsvr32 scrrun. dll


Problem 4: Debugging cannot be started on the Web Server
Causes and Solutions
1. Does a Web application have a Web. config file? Does the Web. config file set the debug attribute to true?
2. Is it a member of the Debugger Users Group?
3. Internet Options of IE-> Security-> Intranet-> User-Defined Level-> User-verified "automatically use the current user and password to log on


Question 5:
The Web server reported the following error: "Http/1.1 400 Bad request

Causes and Solutions
1. There are two IP addresses. Therefore, the localhost error occurs. Change the IP address in iis to "all unallocated ".

2. Step 1 re-register Asp.net in IIS and run the following command: aspnet_regiis-I
Step 2: Go to the IIS manager, change "default website"-"properties"-"website", and change "ip address" to "(all are not allocated )"; click "WEB Service extension" and set "ASP. change "NET v1.1.4322" to "allow ".


Question 6: In the following cases, Microsoft Visual Studio. NET 2003 cannot open an existing ASP. NET 1.1 Web Project :? In the "Web service extensions" list, set ASP. NET 1.1 to "forbidden ".

-And-
In the Web service extensions list, set ASP. NET 1.0 to "allowed ".

And-
The computer is running Microsoft Windows Server 2003.
When you try to create a new ASP. NET 1.1 Project, you may receive the following error message:

Visual Studio. NET has detected that the specified Web server is not running ASP. NET version 1.1.You will be unable to run ASP. NET Web applications or services.

Causes and Solutions

In IIS 6.0, change the ASP. NET 1.1 Status to "Allowed" in the "Web service extensions" list ". To do this, follow these steps: 1. Click Start, point to program, and then click Control Panel ".
2. Double-click "Administrative Tools" and double-click "Internet Information Service (IIS )".
3. Click "Web Service extension ".
4. In the details pane, click ASP. NET v1.1.4322 in the "Web service extensions" list ".
5. Click "allow" to change the status from "forbidden" to "allowed ".

If your IIS version is not 6.0. You can use the following method:
-Start-all programs-Microsoft Visual Studio. NET2003-Visual Studio.net tool-Visual Studio. NET 2003 Command Prompt

Open the above Cmd command window and enter: aspnet_regiis/I


Question 7: when you try to open a web project, the web server reports the following error: http/1.1 500 Internal server error

Causes and Solutions
1. Use proxy to access the Internet
2. regsvr32 script. dll
3. Step 1: First add/delete programs and reinstall the FRONTPAGE extension service in the IIS component.
Step 2: Go to Administrative Tools, INTERNET Options, default site, right-click Properties. Main directory. Check the write permission and click Create. OK.
4. Run Regsvr32 scrrun. dll

Question 8:
Vs.net has detected that the developed WEB server is not running ASP. NET1.1. You cannot run ASP. net web applications or services.
Cause and solution:
1. cause: Delete the "Default web site" in IIS and create a new site. If the site runs normally, it cannot be compiled or created. If a non-1.1 version error occurs, the previous error occurs because, the server uses a fixed IP address, and the Administrator uses the IP address in the attribute as the specified IP address.
Solution: 1. check whether version 1.1 is installed. Check the path C: \ WINNT \ Microsoft. NET \ Framework \ v1.1.4322, reinstall aspnet_regiis, and make sure that "Default web site" is used in your "Internet Information Service" and the IP address in its properties is "(all are not allocated) ", instead of the IP address you have specified. If IE uses a Proxy, hook the Bypass Proxy Server for local adresses,
In addition, the parameters of aspnet_regiis


Question 9: http redirect request failed
Cause: whether to use Forms verification in the program. Modify the verification settings in web. config.


Question 10: When vs.net develops asp.net to create a project, it prompts "A connection cannot be established with the server ".
IIS Problems
Run C: \ WINDOWS \ Microsoft. NET \ Framework \ v1.1.4322 \ aspnet_regiis.exe-I


Question 11: An error occurred while trying to run the project: Debugging cannot be started on the web Server. debugging of Asp.net or Atl Server cannot be started.
Description
Http://support.microsoft.com /? Scid = kb; zh-cn; 318465
Run in the doscommand window
Enter WINNT \ Microsoft. NET \ Framework \ v1.1.4322
Cd C: \ WINNT \ Microsoft. NET \ Framework \ v1.1.4322
Execute aspnet_regiis.exe/I


Question 12: VS 2003 when creating a project, an error occurs: The VC package is unavailable or not registered.
To solve this problem, run the Visual Studio. NET repair program. The fix enforces registration of items that are not registered in the installer, so it can solve the problem more effectively.

Follow these steps to run the repair program:
In the beginning, point to "Settings", click control panel, and then click "Add/delete programs". In the list of installed programs listed, click Visual Studio. and then click "change/Delete". Then, click Visual Studio. NET installation dialog box 1 2 3 the second item in the project;
Click "repair/reinstall" and follow the on-screen prompts.
More information: How to reproduce this problem
To reproduce this problem, it is best to have two operating systems mounted on the independent partition, two Windows XP Professional will achieve this purpose.
1. Install Visual Studio. NET in an operating system;
2. in Visual Studio. NET on another operating system, change the default installation path during installation to match the path for the first installation. (Both installation results will be declared successful)
3. Start Visual Studio. NET installed for the second time (you will find this problem reproduced ).
This installation method is never recommended. Even if the two installation options are identical and you save disk space, this method has a great chance of potential problems. If a Visual Studio. NET changes the file and registration options, these changes are not recorded in another Visual Studio. NET, resulting in a potential risk of unexpected results.

In addition, if you reinstall the system and then reinstall. NET to the same directory before the system is reinstalled (the original files under this directory are not deleted), there may also be a "VC package unavailable or not registered" error message!

Question 13: An error occurred while trying to run the project: you cannot start debugging on the Web server.
Problem and Solution:
1. debug ASP. NET Projects
Check whether the project has a valid Web. config file, whether the Web. config file sets "debug" to "true", and whether the debug predicate is associated with. aspx.
2. debug the ISAPI application
To debug an ISAPI application, pay special attention to the setting steps. The general steps for debugging preparation include:

Create a solution for the server application with options for interactive service running.
In "User Manager", Set permissions. You must log out and log on again to make the permission take effect.
Stop and restart the service.

3
Step 1:. Integrated window Authentication
Right-click "my computer"-> "management"-> "services and applications"-> "Internet Information Service Manager"
-> "Website"-> "default website"-> "properties"-> "Directory Security" tab-> "authentication and access control block"-> "editing"-> select "Integrated windows Authentication" (for win2003 systems, other systems are roughly the same)

Step 2. After integrated authentication, use the following windows user accounts for anonymous users,
The username is machine name \ IUSR _ machine name, And the password is automatically added. This user belongs to the Guests user group and cannot be changed.
Built-in account for anonymous access to Internet Information Service

Step: the logon user belongs to the Debuger Group and Adminstrator Group (debugging permission and full control of the file), and the ASPNET user belongs to the Administrator Group (apsx file operation permission)

Step 4. Automatically log on with the current user name and password in IE (valid only after you log off and log on again)
"Tool"-> "Internet Options"-> "Custom Level"-> "automatically log on with the current user name and password"

Step 5. Check whether the "keep HTTP Connection" check box is selected. If not, select.

Step 6:. No application is created.
Control Panel --> management tools --> Internet Information Service --> Find your project
--> Attribute -- "virtual directory option. The following is an <Application name> followed by a <button>,
Check whether it is created or deleted. If it is created, click the button to delete it and save it.


Question 14: The web server reports the following error. The server name and address cannot be resolved.
I found that this is not. net problems, but your system problems. In this case, when the network connection is smooth, this error will naturally disappear. Of course, you should first check the web in your program. config to check whether there are external IP addresses or URLs and whether the database is connected to the Internet. check the virtual path in the CSPROJ file. If there are no errors, it is only because your system has a problem.

Question 15: Visual Studio. NET cannot create or open an application. The problem is probably because the required components are not installed on the Local Web server. Run Visual Studio. NET installer and add Web development components.

Cause:
This is mainly because the path of the virtual directory created in IIS is inconsistent with the actual path in the project. We can solve this problem in this way.
Find the csprojl.info file in the project and the sln file. Open it with notes and check the first three lines of the two files. There must be a virtual directory path in the middle, first, make sure that the paths in these two files are the same. start IIS and create a new virtual directory based on the path in csproj.info and sln.

Question 16: Visual Studio. NET cannot create or open an application. The problem is probably because the required components are not installed on the Local WEB server. Run Visual Studio. NET installer and add WEB development components.

Cause: Generally, this error occurs when you copy a copy from another host or from another location to your own host to open the project, most of which are not placed in the default root directory of iis, that is to say, you may not have created a virtual directory that corresponds to each other. Of course, this problem also occurs if you do not reference related components in the project.

The following are common methods found on the Internet:

 
1. Confirm that IIS is installed. One way is to open control panel and select Internet Service Manager ". If IIS is installed, you can use this utility to stop and start it.
If IIS is not installed, on Windows Control Panel, select add or delete programs, and then select Add/delete Windows Components ". In the list, select "Internet Information Service (IIS)" and continue the installation. For more information, see Windows Help.

When installing IIS, we strongly recommend that you ensure the security of your Web server computer. For more information, see the installation document file WebServer.htm. The installation path of this file on CD is Disk1 \ Setup \ WebServer.htm. After Visual Studio is installed, you can find the file at % install % \ CSetupMM \ WebServer.htm on the hard disk.
2. install or reinstall the. NET Framework. Run Visual Studio. NET and select option 1 "Windows component Update ".
Note if you are sure that the current. NET Framework version is installed on the Web server computer, skip this step.
3. Open the "run" window for Windows, and type the following to enable ASP. NET:
Aspnet_regiis.exe/I
Prompt that you can open the command window directly from the correct directory of the command. From the "Start" menu of Windows, point to "program", "Visual Studio. NET 2003", "Visual Studio. NET tool", and select "Visual Studio. NET command prompt ". After the window opens, type aspnet_regiis/I.
4. Install the Visual Studio. NET Server component.
A. Run Visual Studio. NET again and select option 2 "Visual Studio. NET ".
The system prompts you to run the installation from the control panel by selecting "add or delete programs" and Microsoft Visual Studio.. NET (the specific name varies slightly depending on the installed version and language), and then click Change/Delete ".
B. Select "add or delete function ".
C. Open the "server components" node and select "Web development ".
D. Click "update now !"
5. Execute security lock on IIS, but then enable ASP. NET.
If you are running IIS 2000 on Windows 5.0 or Windows XP, you can use the IIS lock tool (Version 2.1 ).


Question 17: The project you are trying to open is a local project. You need to specify its file path to open it.

Solution: Create a new project and add all the folders in the current project to the new project.

Question 18: the message "You cannot directly start a project with a Class Library output type. Go to the debug tab under configuration settings in Project Properties" is set to start an external program or a startup URL, another way is to add a non-Library Project referenced by this project to the solution and set it to start.
Cause: the solution contains two or more projects, no startup project is set, or files not supported in the startup project are set. Only web projects and Form projects can be started for the project, and Console.
Solution:
Method 1: Change menu-> Project-> attribute output type to Windows Application
Method 2: Solution Explorer-> right-click-> set startup project

Question 19:
In VS. NET 2003, press F5 to run the ASP. NET project. The error prompt dialog box is displayed. The content is as follows:
Error while trying to run project: Unable to start debugging on the web server. You do not have permission to debug the application. The URL for this project is in the Internet zone.

Solution:
This issue cannot cause an exception. The cause of this issue is probably the permission issue. If debugging fails, you can try the following two steps:
1. Internet Explorer-> Internet Options-> Security-> Custom Internet-> user verification-> login: automatically use the current user name and password
2. Right-click the project in Solution Explorer and select "properties". In the displayed window, select "configuration properties"/"debug" to enable ASP. NET debugging "changed to" Ture"


Query the parameter aspnet_regiis/all under vs.net command prompt of vs.net tool of the program.
So much for the time being. I hope it will be useful to you later :)


There are also some related things on MSDN, which can be used to show you some help when you encounter problems.
Integration of Web Project and source code management in Visual Studio. NET
Http://msdn.microsoft.com/library/chs/default.asp? Url =/library/CHS/sccvs70... ntrolintegrationinvisualstudionet_convert.asp
Q: Debugging cannot be started, causing catastrophic errors (Common Errors When debugging ASP. NET Applications in Visual Studio. NET)
A: http://support.microsoft.com /? Id = 306172

Problems and Solutions that ASP. NET cannot be debugged

The most common one is that ASP. NET cannot be debugged: the browser can be started normally and the code runs normally, but the breakpoint is invalid.

1. This is mainly because of the setup problem of IE browser. In the default advanced options of IE6 IE7, script debugging is not checked, but IE8 disables script debugging.

If you disable script debugging, the above situation will occur, that is, the browser can start normally and the code runs normally, but the breakpoint is invalid.

In my impression, it seems that this is only related to js debugging, and it is also related to ASP. NET debugging.

2. The possible cause of this debugging error is that the ASP. NET debugger is not used in the project options. On the property page, check the startup options = and ASP. NET.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.