异常详细信息: IBatisNet.Common.Exceptions.ConfigurationException: Unable to load embedded resource from as
异常详细信息: IBatisNet.Common.Exceptions.ConfigurationException: Unable to load embedded resource from assembly "DG_URCM.Model.Maps.News.xml, DG_URCM.Model".
1. 源错误:
行 36: public static T Load<T>()
行 37: {
行 38: return GetContainer().Resolve<T>();
行 39: }
行 40:
源文件: D:\GDGL\DG_URCM.Web\1\ServiceLoader.cs 行: 38
[ConfigurationException: Unable to load embedded resource from assembly "DG_URCM.Model.Maps.News.xml, DG_URCM.Model".]
IBatisNet.Common.Utilities.Resources.GetEmbeddedResourceAsXmlDocument(String resource) +707
IBatisNet.Common.Utilities.Resources.GetAsXmlDocument(XmlNode node, NameValueCollection properties) +329
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureSqlMap() +706
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Initialize() +5078
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean isCallFromDao) +345
2. source code: servicesload.cs
public static T Load<T>()
{
return GetContainer().Resolve<T>();
}
3. news.xml code:
<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace="News">
<alias>
<typeAlias alias="News" type="DG_URCM.Model.News, DG_URCM.Model" />
</alias>
<resultMaps>
<resultMap id="News_Result" class="News">
<result property="NewsId" column="NewsId" />
<result property="Title" column="Title" />
<result property="Content" column="Content" />
<result property="Author" column="Author" />
<result property="AddTime" column="AddTime" />
<result property="UserId" column="UserId" />
</resultMap>
</resultMaps>
<cacheModels>
<cacheModel id="News_Cache" implementation="LRU">
<flushInterval hours="120"/>
<flushOnExecute statement="InsertNews"/>
<flushOnExecute statement="UpdateNews"/>
<flushOnExecute statement="DeleteNews"/>
<property name="CacheSize" value="20"/>
</cacheModel>
</cacheModels>
<statements>
<select id="FindNews" parameterClass="String" resultMap="News_Result" cacheModel="News_Cache">
SELECT * FROM [TB_News] WHERE NewsId = #value#
</select>
<insert id="InsertNews" parameterClass="News">
INSERT INTO [TB_News] ([NewsId], [Title], [Content], [Author], [AddTime], [UserId])
VALUES (dbo.fn_CreateNewsId(), #Title#, #Content#, #Author#, #AddTime#, #UserId#)
</insert>
<update id="UpdateNews" parameterClass="News">
UPDATE [TB_News] SET [Title] = #Title#, [Content] = #Content#, [Author] = #Author#, [AddTime] = #AddTime#, [UserId] = #UserId#
WHERE [NewsId] = #NewsId#
</update>
<delete id="DeleteNews" parameterClass="String">
DELETE FROM [TB_News] WHERE [NewsId] = #value#
</delete>
<select id="FindAllNews" parameterClass="map" resultMap="News_Result" cacheModel="News_Cache">
SELECT * FROM [TB_News]
<dynamic prepend="Where">
<isNotEmpty property="Title" prepend="And">
Title Like '%$Title$%'
</isNotEmpty>
<isNotEmpty property="AddTime" prepend="And">
AddTime = #AddTime#
</isNotEmpty>
<isNotEmpty property="Year" prepend="And">
DATEPART(year, AddTime) = #Year#
</isNotEmpty>
</dynamic>
Order By AddTime Desc
</select>
<select id="GetNewsCount" parameterClass="map" resultClass="int">
SELECT Count(*) FROM [TB_News]
<dynamic prepend="Where">
<isNotEmpty property="Title" prepend="And">
Title Like '%$Title$%'
</isNotEmpty>
<isNotEmpty property="AddTime" prepend="And">
AddTime = #AddTime#
</isNotEmpty>
<isNotEmpty property="Year" prepend="And">
DATEPART(year, AddTime) = #Year#
</isNotEmpty>
</dynamic>
</select>
<select id="FindNewsByTime" parameterClass="map" resultMap="News_Result" cacheModel="News_Cache">
SELECT * FROM [TB_News]
<dynamic prepend="Where">
<isNotEmpty property="AddTime" prepend="And">
datediff(dd,#AddTime#,addtime)=0
</isNotEmpty>
</dynamic>
</select>
<select id="FindNewsByKeyWord" parameterClass="map" resultMap="News_Result" cacheModel="News_Cache">
SELECT * FROM [TB_News]
<dynamic prepend="Where">
<isNotEmpty property="Title" prepend="And">
Title Like '%$Title$%'
</isNotEmpty>
</dynamic>
</select>
<select id="FindNewsByTimeAndKeyword" parameterClass="map" resultMap="News_Result" cacheModel="News_Cache">
SELECT * FROM [TB_News]
<dynamic prepend="Where">
<isNotEmpty property="AddTime" prepend="And">
datediff(dd,#AddTime#,addtime)=0
</isNotEmpty>
<isNotEmpty property="Title" prepend="And">
Title like '%$Title$%'
</isNotEmpty>
</dynamic>
</select>
</statements>
</sqlMap>
thank you
yaqi