方案的结构如下图
DAL为类库,被MVC项目App调用。Paramater.xml在DAL内。请问,DAL内的下列代码怎么读不到Paramater.xml?
string rootPath = string.Empty;
StringBuilder myMapInfos = new StringBuilder();
System.Xml.XmlDocument myXmlDocument = new System.Xml.XmlDocument();
string myCode = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
string myXmlPath = (System.IO.Path.GetDirectoryName(myCode) + "\\Paramater.xml").Remove(0,6).Replace("\\", "/");
XDocument doc = XDocument.Load(myXmlPath);//此句读不到XML文件