An unknown error occurred while installing dnn. The cause is finally found.

Source: Internet
Author: User
Tags dnn
After analyzing through the event probe in the morning, you are always unwilling to execute the script clearly in the SQL service. Why is it wrong to run the script as a database installation file? I decided to trace the source code to find the cause.
Fortunately, I have the source code 3.3.7 in my hand. After creating a new site, I open vs2003 and set the breakpoint (sorry to tell everyone, although dnn has so many versions, but I have never read the source code well. It is really a success, so it took me a lot of time to set the position of the breakpoint, and dnn is really strong ). The breakpoint can be set ~ In the public function install () as Boolean method of \ dotnetnuke \ Components \ resourceinstaller \ painstaller. VB

On the factory. getdnninstaller. Install (_ dnnfolders) statement, this is to install the files in the specified directory through the factory method.
Another breakpoint is set in the protected overridable function batchsql (byval sqlfile as pafile) as Boolean method in padnninstallerbase. VB. After tracking found that dnn will first get your installation file encoding, UTF-8 UTF-7, utf16bigendian and so on, and then according to the encoding to get the script in the file and then execute.

The problem was finally found here, and my database installation script was encoded into the UTF-7 (ANSI), so after the dnn re-encoding, "'" turned into "'' ", "+" is also missing. As for why this is the case, I have no energy to analyze it for the moment. After you change the installation file to a UTF-8, the problem is resolved. In the solution also found a strange phenomenon, I opened with editplus, with another UTF-8 to overwrite the original file, and then re-open found that encoding has not been changed, I do not know whether it is the editplus bug or my version is incorrect. I am using Chinese.

Summary: In. net, it is best to use UTF-8 to encode the configuration file.

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.