首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Visual Studio OData“添加服务引用”代码生成失败

Visual Studio OData“添加服务引用”代码生成失败
EN

Stack Overflow用户
提问于 2014-03-14 22:24:15
回答 1查看 3.5K关注 0票数 2

This data.gov website提供了一个OData数据导出,其中包含使用链接http://data.cms.gov/OData.svc/97k6-zzx3的说明

(在NugetingService5.6.1版之后)我尝试在Visual Studio2012或Visual Studio2013中使用指向我的C#项目的“添加服务引用”的完整链接,我得到There was an error downloading 'http://data.cms.gov/OData.svc/97k6-zzx3/_vti_bin/ListData.svc/$metadata'. The request failed with HTTP status 404: Not Found. ...

如果我将URL截断为http://data.cms.gov/OData.svc,那么我会得到进一步的结果,但仍然是一个错误The custom tool 'DataServicesCoreClientGenerator' failed. Data service client code-generation failed: Schema specified is not valid. Errors: ... The 'Name' attribute is invalid - the value '97k6-zzx3' is invalid according to its datatype (我想是因为C#标识符不能以数字开头)。

这是data.cms.gov或Visual Studio (等)的错误吗?是否有近距离的变通方法?

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2014-03-14 22:51:31

尝试使用https://data.cms.gov/OData.svc/$metadata。代码生成需要元数据,上面的URL将提供元数据。

URL是服务文档,而不是元数据。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22407728

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档