IBatisNet.DataMapper 升级到 1.6.2 之后报错

ContractedBlock.gif ExpandedBlockStart.gif Code
 private static volatile ISqlMapper _mapper = null;

        
protected static void Configure(object obj)
        {
            _mapper 
= null;
        }

        
protected static void InitMapper()
        {
            ConfigureHandler handler 
= new ConfigureHandler(Configure);
            DomSqlMapBuilder builder 
= new DomSqlMapBuilder();
            _mapper 
= builder.ConfigureAndWatch(handler);
        }

        
public static ISqlMapper Instance()
        {
            
if (_mapper == null)
            {
                
lock (typeof(SqlMapper))
                {
                    
if (_mapper == null// double-check
                    {
                        InitMapper();
                    }
                }
            }
            
return _mapper;
        }

        
public static ISqlMapper Get()
        {
            
return Instance();
        }

 

编译通过了,_mapper = builder.ConfigureAndWatch(handler);老是报 The error occurred while Validate SqlMap config.

查到原因:升级之后所有配置文件采用标准XML格式了!

可参照:http://shanyou.cnblogs.com/archive/2005/10/17/256720.aspx 进行配置!

 

 

转载于:https://www.cnblogs.com/DanielChow/archive/2009/05/16/1458178.html

你可能感兴趣的:(IBatisNet.DataMapper 升级到 1.6.2 之后报错)