MVC4 website Publishing (collation + partial problem collection and solution) _win Server

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

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

If offended please contact me, or delete, or mark the source.

Because the good article, previously only wanted to collect, but the connection sometimes will be invalidated, therefore now encounters the good direct transfer to oneself here.

Website Publishing steps:

1, open your VS2012 website project, right click item menu to regenerate the site project; Click Right again to publish:

2, pop-up Web publishing Settings panel, click < New. To create a new publish profile:

Enter your own definition of the profile name:

3, click Next: In the Publish method select "File System", so we can publish to their own designated local files.

Select the folder you specified: Create a new folder by clicking on the red arrow in the upper right corner of the image below, and customizing the name (my website). Click Open to go to the next step

4, in the configuration, to choose "Release"-Publishing mode ( release, known as released version, it is often a variety of optimizations, so that the code size and speed of the program is optimal, so that users are well used.) Debug is often referred to as the debug version, which contains debugging information and is not optimized for programmers to debug programs.

5, click Next: Enter the preview before the release of the interface

Click Publish to publish the folder you specified, and here I am releasing the website folder under C disk.

After the success of the release, click the folder, all the pages of the. cs files have disappeared, where have you gone? Is it inside the bin folder? Let's take a guess.

Post a good screenshot:

6. Launch the Internet Information Services (IIS) Manager into the IIS interface through the "Control Panel" management tool.

Right-click Web site Add site

7, the following figure, the left red box to enter a custom site name (please try to use English, here I write myphotosite), the right red arrow to click on the ' Select (E) ... ' Make changes.

You can click on the Drop-down list box according to your own version of the site to choose (generally please choose not with classic). Here I choose to choose DefaultAppPool,

8, select the physical path of the published Web site folder.

9, click the Drop-down list to select "Their current IP address"

Click OK: At this time our site is still a step on the release of good, click the site Myphotossite, and then click on the red arrow below to switch to the "content view."

10, the 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 an administrator. (If you are not running as an administrator, you will be prompted for "Insufficient permissions" error)

After running, right-click to paste aspnet_regiis-i press ENTER. Waiting to run about 1 minutes prompted installation completed (my machine slow so provide 1 minutes for everyone to refer to, we do not worry slowly waiting for installation to complete).

Finally, find your own website homepage, right click to browse. IE sometimes does not respond (the Address bar appears blank), to be able to browse several times to be successful. Show us the results:

Note: This part of the article reproduced above, that a little bit about the blogger's site is not MVC4 site so in the add site that the step is not a discrepancy

The original is to say

You can click on the Drop-down list box according to your own version of the site to choose (generally please choose not with classic). Here I choose to choose DefaultAppPool,

And we're MVC4, so choose ASP.net v4.0.

Would normally immediately report a

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary asp.net files\root\ca8ed912\d7b1512d\app_ Global.asax.6rl89b0n.dll '--' denial of access error.

1, the usual solution: the reason is because the system directory of the Temp directory is not due to the corresponding permissions, the specific operation of the following:c:\windows\temp--> properties--> security--> edit--> Add Network The service user's read and write permissions can be resolved.

2, open Server System C disk, open window, right key Temp Property security Edit Add Iis_iusrs user control rights add modify and Write permission. This is the Windows Server 2008 R2 Standard Version SP1 64-bit Chinese version solution. (This is my problem.) This is the solution, and the network service is not necessary.

IIS Publishing steps:

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

If offended please contact me, or delete, or mark the source.

Because the good article, previously only wanted to collect, but the connection sometimes will be invalidated, therefore now encounters the good direct transfer to oneself here.

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

Web Publishing Environment: win7,iis7.5

Website Authoring Environment: WIN7,VS2010,MVC3

1. Configure IIS7.5

Control Panel--Program--turn on or off the Windows feature--internet Information Service, set up "Internet Information Services" in the following figure, and now IIS7.5 is set up.

2. Website release

2.1. Export the Web site from VS2010

Compile the Solution in the VS2010, and then select Build--publish test (where test is Solution name) in the menu bar to pop up the following window

The website is stored in C:\inetpub\test place

2.2. Go to Internet Information Services to publish Web sites

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

Control Panel (view: Small icon)--Administrative tools (Figure 2)--internet Information Services (IIS) Manager (double-click on the mouse, as shown in Figure 3)--Application pool (open with mouse double-click)

See if there is a asp.net v4.0,asp.net v4.0 Classic in the green box in Figure 3, and 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 to press ENTER (Figure 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 Site

Internet Information Services (IIS) Manager (double-click on the mouse, as shown in Figure 3)--select "Web" right click, pop-up menu, select "Add Site ..." Pop-up Figure 4 window

Figure 4 Adding a Web site

After the operation, the website was published successfully

Double-click the new Web site test, as shown in Figure 5, select "Reboot" on the right, and then click "Browse 192.168.19.19 ..." under "Browse the website" on the right side to view the published Web site in the browser.

Figure 5

Some problems that may arise:

Error:

User ' IIS apppool\asp.net v4.0 ' login failed.

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

Exception Details: System.Data.SqlClient.SqlException: User ' IIS apppool\asp.net v4.0 ' login 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 to log in with the database account password.

Remember to modify the configuration file before your site is published to IIS. The database connection string <connectionStrings> </connectionStrings> in the Web. config file The default in the node or the one you open the debugger to add is probably the previous "." On behalf of the local password is the system default, published to IIS is no way to use, so to change to a generic one is given an example, the first is the system defaults, after use will also appear you this error, Another example that has been fixed 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 processes on the other end of the pipeline

A connection was made to the server successfully, but an error occurred during the logon process. (Provider: Shared Memory provider, error:0-there is no process on the other end of the pipe.) )

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

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

Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.

The workaround is as follows

First select the server (right)-> Properties-> Security-> Server Authentication modified to SQL Server and Windows Authentication mode
Second, expand the server "security"-> login-> selected sa login account (right)-> status-> login modified to enable

Solution steps:
1. Log on to management Studio with Windows, right-click the server selection properties, and change the security options to: SQL Server and Windows Authentication mode.






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




3, open the Configuration tool-> the SQL Server perimeter Application configurator, and after running, select the services and connections perimeter configuration.
First select remote connection-> local connection and remote connection-> use TCP/IP only, click "Apply".
Second, select the service to stop the SQLExpress service before restarting it.





But it doesn't solve my problem.

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

If prompted after startup:

User ' sa ' login failed.

Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the 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= "Information source=.;i 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.