This article is a mirror article of machine translation, please click here to jump to the original article.

View: 19371|Reply: 1

[Source] Some exceptions in Nhibernate under mono Argument cannot be null

[Copy link]
Posted on 8/4/2016 9:21:33 AM | | | |
A few days ago, I moved an old project of asp.net to linux, which is based on asp.net 4.0 + Nhibernate + FluentNhibernate, and encountered a rare problem in the process of migration, climbed a lot of articles, including Chinese, English, and finally found the answer on a Japanese website (by Google Translate), which can be described as quite painful, and I have recorded it
First, the environment to be migrated to is centos6.5 + MONO + Jexus
This happened under Nhibernate + mono, but it didn't always happen, and some of the projects I migrated to were using Nhibernate, so this problem didn't happen
Initial:
The following error was found in the migration
So, honestly go to web.config to modify the configuration
After finding the modification, it is still such a problem, a little distressed, carefully tracked, and found that there is an error when the prompt below is Nhibernate OpenSession, it seems that the problem lies here

At this time, I tried a lot of methods, including rewriting some nhibernate calling methods, crawling a lot of articles, and never finding a solution, until I finally found an explanation from a corner, and the reason for the error was thrown and explained, but the translation was too tiring...

The reason why the error occurred was:

NHibernate.AdoNet.SqlClientSqlCommandSet

With the above tests, I can't find SqlCommandSet....

It seems to be due to the platform

Current solution

nhibernate:

disposition

<property name="adonet.batch_size">0</property>  

FluentNhibernate:

That is, add. AdoNetBatchSize(0)



So far, the problem has been solved, and the above is for the record, and I hope to help people who encounter the same problem to avoid some detours!





Previous:Workaround to make IE6 IE7 IE8 IE9 IE10 IE11 support Bootstrap
Next:spring.net Could not load type from string value 'xxx...
 Landlord| Posted on 8/4/2016 9:23:57 AM |
System.ArgumentNullException: Argument 'Key must not be null' cannot be null


This is the mistake I encountered.

Because when I first started the project, I did not start the database service, and reported an error, and then I started the database service.

This error was reported again.

Solution:

Rebuild the project, or restart IIS to fix it.

Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com