user1023714
user1023714

Reputation: 23

Host MVC and WCF in same appDomain

Is it possible to host in the same appDomain two different projects of WCF service and MVC application?

For example, I need to use some pulic static class from MVC application by my WCF service. But they are in different projects, so this class for them is in different appDomains.

Upvotes: 2

Views: 644

Answers (1)

moribvndvs
moribvndvs

Reputation: 42497

It is quite common to host WCF services within an ASP.NET application (MVC or WebForms). From a coding perspective, the only thing you may need to configure is ASP.NET compatibility mode, if the code WCF is calling requires access to the current HTTP context.

Create your WCF service contracts, and implementations of those contracts, configure your services, bindings, and behaviors in the web.config, as you normally would. Here is another example, which you could create in virtually any ASP.NET application.

Upvotes: 1

Related Questions