【问题标题】:XSD Validation in azure天蓝色的 XSD 验证
【发布时间】: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 文件放在哪里 - 或者我如何更改上面的代码以便它可以在云端运行?

【问题讨论】:

    标签: azure xsd schema


    【解决方案1】:

    我认为您的路径是正确的,可能发生的情况是您的 xsd 未包含在正在上传的包中。检查文件的属性,尤其是构建操作属性以确保它会被复制。

    【讨论】:

    • 我应该在“构建操作”中选择什么以将其包含在包中?
    • 将构建操作更改为内容。
    猜你喜欢
    • 2018-12-27
    • 2016-08-28
    • 2017-05-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-08
    • 1970-01-01
    相关资源
    最近更新 更多