“找不到路径的一部分” C#IIS部署我加载从我applicatin的XML文件:生产
XDocument.Load(HttpContext.Current.Server.MapPath("/") + "XMLMetadata\\Actions.1.xml");
在它工作正常的开发环境。
但是,我部署应用程序后,系统找不到它。
这是错误:
Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\inetpub\wwwroot\XMLMetadata\Actions.1.xml'.
文件部署到
C:\inetpub\wwwroot\MyApp\XMLMetadata\Actions.1.xml
,而不是:
C:\inetpub\wwwroot\XMLMetadata\Actions.1.xml
ASP .NET 4 MVC应用程序 我缺少什么?
虽然当我重读你的文章时,这可能不会有用。 – Chuck