Mvc1.0 Development Summary 2: iis7 and IIS6 some strange exceptions I encountered

Source: Internet
Author: User

What I wrote is nothing new. I can find it on Google, but I am deploying MVC applications on my own.ProgramThe strange problems you encounter can be said to be big or small. After all, the first time you manage and configure the server, you can find the basic deployment steps online. It seems very precious to me.

Iis7 first: 

1.Cocould not load file or assembly 'name' or one of its Dependencies. An attempt was made to load a program with an incorrect format.

I found a lot of reasons for this error on Google. I tried it for a few hours and found that I would reset the compilation options in the MS forum, open Project Properties> compilation Options> change the target CPU from x86 to any CPU, re-compile, but it is useless. Finally, find an articleArticleSimilar to my situation, Cocould not load file or assembly 'name' or one of its Dependencies   The problem this guy encountered is almost the same as that of me. in his introduction, I solved the problem. For this question

I. IISRun the 64-bit Operating System

II.The problem is that the DLL assembly is compiled for a 32-bit operating system,

 Therefore, you need to open the project properties, in the bulid option,Platform targetIt is x86, which means that the application is compiled for a 32-bit system. Why do you have a 32-bit DLL that may use some 64-bit incompatible components, such as mapi and ODBC ..



Of course, the actual problem is that the application pool used by 64-bit IIS does not allow 32-bit DLL to be added to the process. Open the IIS manager, find the application pool of the website, and select Advanced Settings, you can see that there is an option, Enable 32-bit applications" , The default value is false. Talent Is the cause of the exception.

2.HTTP Error 403.14-Forbidden The Web server is configured to not list the contents of this directory

I remember that in ii5 and ii6, this should be considered a directory access permission problem, but no matter how it is set, it does not work. The following is my solution:

Open the iis7 manager. Open Directory Browsing. On the directory browsing page, on the behavior panel, click Enable

1. Open IIS manager.

2. In the features view, double-click directory browsing.

On the directory browsing page, in the actions pane, click Enable.

 

The following section describes how to install framework2.0, 3.0, 3.5, and SP1. After installing the MVC Framework, create a website, configure the database connection, and open the browser.

HTTP Error 403.1-Access prohibited: Access Denied

I found a method on the Internet and tried it.

1Configure it in IIS! By default, it does not work! Open IIS management, find the corresponding directory, and open properties. You can find several options and check to execute the program!

2Use Windows2003 iis6.0. Go to IIS and find "Server Extension" under the website --> select "allow all unknown cgi" and "allow all unknown isapis"

3Programs such as CGI can only be executed in a specific folder. For example, CGI can be effectively executed only when it is stored in a folder named cgi-bin.

4Find the tool in IE, select the Internet option, find the Advanced tab in it, find the friendly URL to display, and remove the selection on the left, everything is OK

5Maybe IIS is not working properly. Use the system disk to reinstall IIS!

6The server is not configured.

7Copy the file to wwwroot? If not, create a virtual directory. Do not explain it.

8, Is → website → properties → script selected in the main directory and executable files, such as NTFS permission folder configuration options → view and use simple file sharing to configure file permissions

9First, you can try to access the virtual directory you created. Use http: // your machine name/your virtual directory name/file name .htm to test whether a static page or HTML page can be viewed!

10. Main directory-> execution permission-> scripts and executable files, and then set the everyone permission

Still the same. LaterCommunitySee

Select site properties in IIS-home directory-Configuration

Select D: \ windows \ microsoft. Net \ framework \ v2.0.50727 \ aspnet_isapi.dll as the executable file, which is very critical and can be viewed.

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.