【发布时间】:2012-12-17 01:17:46
【问题描述】:
我有几项服务想部署到 azure。 每个服务都有一个 xsd 模式,该模式放置在服务所在的项目中。 在验证模块中,我尝试以这种方式加载架构:
XmlSchemaSet schemaSet = new XmlSchemaSet();
Uri baseSchema = new Uri(AppDomain.CurrentDomain.BaseDirectory);
string mySchema = new Uri(baseSchema, "LogInService.xsd").ToString();
XmlSchema schemaLogIn = XmlSchema.Read(new XmlTextReader(mySchema), null);
schemaSet.Add(schemaLogIn);
...但显然路径AppDomain.CurrentDomain.BaseDirectory 不正确,当我尝试部署服务时出现以下错误:
Could not find file 'F:\sitesroot\0\LogInService.xsd'
(在 dev 上这段代码运行良好)
我的问题是,我应该将 xsd 文件放在哪里 - 或者我如何更改上面的代码以便它可以在云端运行?
【问题讨论】: