When configuring ibatis.. Net sqlmap. in config, the error "unable to load embedded resource from assembly" is often prompted. This file exists in a project and is in the root directory, in addition, the generation operation is "embedded resources ". This error is prompted, which is defined:
<Properties embedded = "database. config, piggywinform. Data"/>
After searching for relevant information on the Internet, we found that multiple ". ", instead of a file name here. Therefore, after I add a namespace in front of the file, I did not report this error. This reminds us that the embedded format is:
<Properties embedded = "<namespace> database. config, <ProgramSet> "/>
If the set and namespace of a project are the same, the <namespace> in front of the file can be omitted.
Why embedded? The purpose is to ensure security, especially when developing a winform project, so as to prevent client tampering or XML or other configuration files from being modified due to some other reasons. In particular, the SQL statements in the sqlmap of ibatis.
Today, I think it is uncomfortable to put the xml configuration file of ibatis in the root directory. Put the XML into the map folder. Compile and debug the file directly. As with speculation, an error is indeed reported, prompting that the file cannot be found. Then modify the configuration file and modify embedded:
<Sqlmap embedded = "piggywinformtemplet. Data. Auto. Map. myperson_auto.xml, piggywinform. Data. Auto"/>
Actually succeeded. Therefore, the true format of embedded is:
<Properties embedded = "<namespace>. <relative path>. database. config, <Assembly>"/>
Original Works from the effort to be lazy, reprint please explain the source of the article: http://www.cnblogs.com/kfarvid/