开发者

MaxArrayLength Exception in WPF

I am working o开发者_Python百科n a project that is a website, a mobile app, and a desktop WPF app that all depend on a service. The mobile app works fine, but the desktop and website was having a problem with getting images from the database because of a MaxArrayLength property. We were able to change the web.config file's maxArrayLength property and the website now works, but the desktop application is still broken. We know we should change something in the App.config file, but can't figure out where the maxArrayLength property should be (what tag it's under, etc).

We currently have a direct reference through the desktop to the service, and a service reference through the website. Is there any way to do this without adding a service reference and just being able to keep the direct reference to the service?


Is there any way to do this without adding a service reference and just being able to keep the direct reference to the service?

Why would you want to do that?

If you are referencing the WCF project directly, only hitting some included business logic, your solution might need some project refactoring. Ie., you should have business logic that is used by all your clients in a separate project in order to keep cohesion high.

If you need to call the WCF services to actually access the provided services (and not only call exposed business logic, which might be what you are doing, if my understanding is correct), then you will most likely want to do one of either options:

Option A

Use a service reference (and not a project reference) in order to call the WCF services via an auto-generated proxy.

Option B

Use a facility (with some configuration) and an IoC container to resolve dependencies on your WCF services. See this article for some clues on how to get started. This example uses Castle's very simple WCF Integration Facility.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜