Solve the Problem of uploading mvc to cloud virtual machines, and upload mvc to cloud virtual machines

Source: Internet
Author: User

Solve the Problem of uploading mvc to cloud virtual machines, and upload mvc to cloud virtual machines

I used vs2015 to write a small website ,. net Framework4.5, mvc 5, is released to the local iis normally. After applying for a cloud virtual machine in the US orange, some problems encountered during the release are recorded as follows:

 

1. The version supported by the server is relatively low.

After uploading, open the website to display:

HTTP 404.0-Not Found
The resource you are looking for has been deleted, renamed, or temporarily unavailable.

Ask about the technical support of US orange, saying that only. net framework4.0 and mvc4 are supported.

There is no way to try to downgrade the version. In vs2015, change all the project target frameworks in the solution. net framework4.0, uninstall mvc5 in NuGet and install mvc4. A bunch of errors immediately occur, especially some extended partial classification features of entity classes.

[MaxLength (128, ErrorMessage = "typical customer length cannot exceed 128 characters")]

Cannot be identified. There are many different versions of referenced databases, so you can't start with them.

 

2. Some dll files are missing

So I simply downloaded vs2012, re-created the solution in vs2012, and selected ASP. NET MVC4 Web application, target framework selection. net framework4.0. Currently, only one controller home and one view index are created. After the local access is passed and uploaded to the cloud virtual machine, the Error 404 still persists.

Contact the technical staff of us orange. The other party helped me enable the detailed error report.

I added

  <system.web>    <customErrors mode="Off" />  </system.web>

After accessing the website, the system prompts that the website cannot be loaded ......

As prompted, the System. net. http. formatting. dll, System. web. http. dll, System. web. http. webHost. dll, you can finally see my view.

 

3. Newtonsoft. Json versions after UEditor is added

Use vs2012 to re-create each project and copy each project in the original vs2015 solution one by one.

After copying the plug-in UEditor, run the prompt: failed to load the file or assembly "Newtonsoft. json, Version = 4.5.0.0 ......, check that Newtonsoft in UEditor \ net \ Bin is referenced. json. dll, version 6.0.20.931. I removed the reference and re-referenced packages \ Newtonsoft. newtonsoft in Json.4.5.6 \ lib \ net40. json. dll, but check the referenced Newtonsoft. the Json attribute is still Newtonsoft of version 6.0 in UEditor \ net \ Bin. json, I am a little confused. Why does the re-reference not take effect?

After a great deal of twists and turns, you can modify the web. config file.

<! -- After the UEditor is added, the system prompts that the file or assembly "Newtonsoft" cannot be loaded. json, Version = 4.5.0.0 ...... error --> <runtime> <assemblyBinding xmlns = "urn: schemas-microsoft-com: asm. v1 "> <dependentAssembly> <assemblyIdentity name =" Newtonsoft. json "publicKeyToken =" regular "culture =" neutral "/> <bindingRedirect oldVersion =" 0.0.0.0-6.0.0.0 "newVersion =" 6.0.0.0 "/> </dependentAssembly> </assemblyBinding> </ runtime>

Point all versions of Newtonsoft. Json to the current version 6.0. This problem is solved.

 

4. Error 401.3

Upload the program written in vs2012 after local debugging is passed. When you access the website, the error 401.3 is prompted. The permission problem should be caused. Please handle it with the orange technology. The static html page can be displayed, however, home/index still cannot be opened, and detailed error messages are not displayed. add in config

<System. webServer> <validation validateIntegratedModeConfiguration = "false"/> <! -- After uploading to the cloud virtual machine, you must add this configuration item to open the webpage --> <modules runAllManagedModulesForAllRequests = "true"/> </system. webServer>

Finally, you can see the detailed prompt that the file cannot be loaded, upload the three files to the bin as prompted, and then visit the website to finally run properly.

 

5. I would like to give a thumbs up to the technical support staff of us orange, who answered and solved the problem very quickly and patiently.

 

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.