MVC4 website Release (collation + partial reprint + partial problem collection and solution)

Source: Internet
Author: User
Tags stack trace management studio connectionstrings

Site Publishing steps:

This part is reproduced in this article to mark the source, before there is the article is not marked please understand, because some have been unable to find the source, or other reasons.

If you are offended please contact me, or delete, or indicate the source.

Because the good article, previously only wanted to collect, but the connection sometimes will be invalid, so now meets the good direct transfer to oneself here.

Original source http://blog.sina.com.cn/s/blog_acb983ba0101c5um.html

1. Open your VS2012 website project, right click on the Project menu to regenerate the website project; Right click again to publish:

2. Pop-up website publish Settings panel, click < New. Create a new Publish profile:

Enter your own definition of the profile name:

3. Click Next: In the Publish method, select "File System" so that we can publish to the local files that we specify.

Select the folder you specified: Create a new folder by tapping the red arrow in the upper right corner of the box, and customize the naming (I'll write website). Click Open to go to the next step

4, in the configuration, to choose "Release"-Release mode (release is called the release version, it is often a variety of optimizations, so that the program in code size and speed is optimal, so that the user is good to use. Debug is often called a debug version, it contains debug information, and does not make any optimizations to facilitate the programmer to debug the program)

5. Click Next: Enter the pre-Release preview screen

Click Publish to publish the folder you specified, where I posted the website folder under the C drive.

After publishing successfully, click Open Folder, all the pages of the. cs files are gone, where have all gone? Is it inside the bin folder? Let's take a guess.

Posted Good:

6. Through the Control Panel management tool, start Internet Information Services (IIS) Manager to enter the IIS interface.

Right-click Site to add a Web site

7, the following picture, the left red box to enter a custom site name (please try to use English, here I will write myphotosite), the right Red Arrows need to click ' Select (E) ... ' Make changes.

You can click the drop-down list box to choose according to your website version (generally choose not with classic). Here I choose to choose DefaultAppPool,

8. Select the physical path of the published site folder.

9. Click the drop-down list to select "Your current IP address"

Click OK: At this point our site is one step ahead of the release, click on the site Myphotossite, and then click the red arrow to switch to the "content view."

10. Last Step: Register the IIS server. Command: aspnet_regiis-i (please copy), first in the program menu "VS2012" Visual Studio Tools VS2012 developer command Prompt. Right-click the VS2012 developer command prompt. Run as Administrator. (the "Insufficient permissions" error will be prompted if you are not running as an administrator)

After running, right-click Paste Aspnet_regiis-i Press ENTER. Wait for about 1 minutes to run the prompt installation is complete (my machine is slow so provide 1 minutes for everyone to refer to, we do not worry about slowly waiting for installation to complete).

Finally, find your own website home page, right-click Browse. IE sometimes does not respond (the Address bar appears blank), it will be more than a few times to succeed. Show us the results:

Description: The above reproduced in this part of the article, it is a little bit about the blogger's website is not MVC4 site, so in the add site that step is a discrepancy

The original word is

You can click the drop-down list box to choose according to your website version (generally choose not with classic). Here I choose to choose DefaultAppPool,

And we're MVC4, so choose the ASP. v4.0 (because this one comes with classic)

IIS Publishing steps:

This part is reproduced in this article to mark the source, before there is the article is not marked please understand, because some have been unable to find the source, or other reasons.

If you are offended please contact me, or delete, or indicate the source.

Because the good article, previously only wanted to collect, but the connection sometimes will be invalid, so now meets the good direct transfer to oneself here.

Original source http://www.soaspx.com/dotnet/asp.net/DPattern/dpattern_20120621_9306.html

Site Publishing Environment: win7,iis7.5

Site Authoring Environment: WIN7,VS2010,MVC3

1. Configure IIS7.5

Control Panel-Programs-turn Windows features on or off--internet information services, set up "Internet Information Services" now IIS7.5.

2. Website release

2.1. Exporting a Web site from VS2010

Compile the solution in VS2010 and then select Build--publish Test (here test is the solution name) in the menu bar to pop up the following window.

Site is stored in C:\inetpub\test place

2.2. Go to the Internet Information Services publishing site

2.2.1 See if the application pool contains ASP. V4.0,asp.net v4.0 Classic

Control Panel (View by: Small icon)--Administrative Tools (2)--internet Information Services (IIS) Manager (mouse double-click on, 3)--Application pool (mouse double-click to open),

See if there is an ASP. V4.0,asp.net v4.0 Classic in the green box in Figure 3, if not, the framework is not fully installed, in which case the published Web site is inaccessible.

Workaround:

To start--cmd, enter the following string of characters in the Command Manager press ENTER (1):
%windir%\microsoft.net\framework\v4.0.30319\aspnet_regiis.exe-i

Figure 1 cmd

Figure 2 Management Tools

Figure 3 Internet Information Services (IIS) Manager

2.2.2 Publishing Web site

Internet Information Services (IIS) Manager (mouse double-click to open, 3)--select "Site" right-click, pop-up menu, select "Add website ..." Pop Up Figure 4 window

Figure 4 Adding a Web site

After the operation, the website is published successfully.

Double-click on the new site test,5, select "Restart" on the right, then click "Browse 192.168.19.19 ..." under "Browsing site" on the right, and you can view the published website in the browser.

Figure 5

Some of the problems that may arise:

Error:

The user ' IIS apppool\asp.net v4.0 ' logon failed.

Description: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace information For more information about the error and the source of the error in your code.

Exception Details: System.Data.SqlClient.SqlException: User ' IIS apppool\asp.net v4.0 ' logon failed.

Source Error:

执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

user ' IIS apppool\asp.net v4.0 ' login failure how to solve Ah, you master?
Because your program connects SQL Server's connection string with Windows Integrated login, you can change it to log in with your database account password.

Remember to modify the configuration file before you publish your site to IIS. The database connection string in the Web. config file <connectionStrings> </connectionStrings> node in the default or your own debug program added is likely to be the previous "." On behalf of the local password is used by the system default, published to IIS is not used, so to change to the general of the given is an example, the first is the system default, after use will also appear you this error, Another example that has been repaired is the correct default: <!--<add name= "Tendersystemcontext" connectionstring= "Data source=.;i Nitial catalog=delixitendersystem;integrated security=true; Multipleactiveresultsets=true "          providername=" System.Data.SqlClient "/>--> correct: <add name=" Tendersystemcontext "connectionstring=" Data source=it-chenxiaopeng\;initial Catalog=delixitendersystem; User Id=sa; Password=sql+server; Multipleactiveresultsets=true "      providername=" System.Data.SqlClient "/>

Provider: Shared Memory provider, error:0-no process on the other end of the pipeline has successfully established a connection to the server, but an error occurred during the logon process. (Provider: Shared Memory provider, error:0-no process on the other end of the pipeline.) )

User ' sa ' login failed. The user is not associated with a trusted SQL Server connection.
Description: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace information For more information about the error and the source of the error in your code.

Exception Details: System.Data.SqlClient.SqlException: User ' sa ' login failed. The user is not associated with a trusted SQL Server connection.

Description: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace information For more information about the error and the source of the error in your code.

Here's how to fix it

First select Server (right-click), Properties---Security server Authentication modified to "SQL Server and Windows Authentication mode"
Next expand "Security" on the server, login name, and check the sa login account (right-click)--state--Login modify to enable

Steps to resolve:
1. Log in to management Studio as Windows, right-click the server select Properties, and change the security option to: SQL Server and Windows authentication mode.






2. Set the properties of the SA user in the security-and login name, and in the Status column there is a "login" entry, which is disabled by default and enabled instead.




3. Open the SQL Server surface Area Configurator, Configuration tool, and after running, select the surface area configuration for services and connections.
First select remote connection, local area connection and remote connection, use TCP/IP only, click "Apply".
Next, select the service to stop the SQLExpress service before restarting it.





Transfer from: http://hi.baidu.com/hongfeisong/blog/item/96a4c158cb1afe84800a18b4.html

But it didn't solve my problem.

Later found. The SQL Server Brower service did not start and restart the service. Then restart the SQL Server service.

If prompted after startup:

User ' sa ' login failed.

Description: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace information For more information about the error and the source of the error in your code.

Exception Details: System.Data.SqlClient.SqlException: User ' sa ' login failed.

Modify the corresponding code in the Webconfig.

<connectionstrings>
<add name= data connection name connectionstring= nitial catalog= database; pwd= your password; "
   providername= "System.Data.SqlClient"/>

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.