I have WCF application and MVC application in 1 solution. When I deploy projects with WCF, I always deployed them like 2 sites. Firstly, I deployed WCF application to IIS, then MVC application and use WCF's endpoint address.
My question is that, is it possible to deploy MVC and WCF applications together, not like 2 separate site? WCF runs inside ASP application. And in IIS we have 1 site.
Yes it is possible. Merge WCF application & MVC application together into a single project. If your WCF project contains too many classes you can move them into a class library.
But you must move following items into web application project:
Move .svc file into MVC project, this file does all the magic to
host your WCF service into IIS.
Move System.Service Model section of WCF application into MVC
project.
I done this.. Works well in local...
But When you host it in an IIS or web deploying
add this code in webconfig
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Related
I have crated WCF service.
Service client as - MVC 4 application. Added - Service reference into MVC 4 applicaiton.
Problem: In client application, unable to find - servicerefernececlient object to access service methods.
When i add same service reference into asp.net web applicaiton then it works and available to call service method. But, it is unavailable while access through MVC application.
DETAIL: In my solution there are three projects as follow: 1) WCF Applications ervice 2) ASP.NET Web Application 3) MVC 4 application.
WCF Applicaton service refernec added into both the projects using "Add service reference" . NOw, service reference instance is available into ASP.NET WEB applicaiton but, its not available into MVC 4 applicaiton.
Please suggest solution.
Please guide.
Thank You
can you describe it in more detail? The service reference is shown in your solution explorer like in a normal asp.net classic application? How do you generate the service client? Using Visual Studio via right-click > Add > Service Reference?
We have a solution with this structure.
OurApp.Web (mvc 3 project with controllers, views)
OurApp.Api (mvc 3 project with wcf web api service classes)
OurApp.Domain (entities, repositories, unit of work, etc)
OurApp.Tests (tests)
We want to use a dns structured like this:
http://www.ourapp.com points to OurApp.Web
http://api.ourapp.com points to OurApp.Api
We want to host on AppHarbor.
How can we do this?
AppHarbor currently only supports deploying one application from any given repository. One option might be to fold the API into the web project. I did this for a non-web API WCF service here.
Another option is to maintain two AppHarbor applications, and use solution files named according to what application you want deployed for that application. That is, OurApp.Web.sln contains the Web project and any supporting projects and, OurApp.Api.sln references the API project and any supporting projects. Read more about AppHarbor solution file convention.
(disclaimer, I'm co-founder of AppHarbor)
Hi,
I have done the following :
Start Visual Studio 2010
New Project > ASP.NET MVC
Default ASP.NET MVC project generated by VS2010
Add a couple off simple buttons on the first page
Start local IIS manager, Create a web application and point it to the ASP.NET MVC project
Set correct right on the ASP.NET MVC project folder(to the user running the thread pool in IIS7)
Browse site (http://localhost/MyTestSight/) and the first page is shown
Upload site to www.test.figurspel.net
Host sets the site to be runned on .NET 4.0
Browse www.test.figurspel.net and the site is not working?
The host has checked that tha Active Server Page is set to allow
Host has installed up to MVC 3
I could turn on the Browsable to see the file structure but this will not help to get the site running.
How do I get this asp.NET MVC web site running?
BestRegards
Is the application pool running in integrated mode the IIS site running under that application pool?
It's my understanding that if this isn't the case, the MVC site will not run.
Alternatively, have you tried this?
+1 Unicorn power HooooooO!!!!! Also I've always when hosting a site published the project to a different folder then setup the site via IIS from that folder hope this helps.
I have a solution with 1 asp.net mvc application and some class libraries (core, repo, service, tests).
What are steps needed to convert this solution to azure ?
An ASP.NET MVC 3 application is nothing more than an ASP.NET application so the following blog post stands true.
I can’t get a basic MVC site to work on my web server unless I’ve compiled it first in Visual Web Developer. If it doesn’t have a dll in the Bin, it says the Namespace can’t be found.
In classic asp.net I could just upload the files and the server would compile it at first run. Is this not the case in MVC? Essentially I’d like to build an MVC site without using Visual Web Developer.
That's cause ASP.NET MVC is not based on the Website model that many ASP.NET Web Forms apps were. It is based on the Web application model.
You can read about Web Application Projects here.
I've read about people migrating the Web Application to the Web site model in ASP.NET MVC but I don't recommended it.
Yes, you do need to compile an MVC site and deploy some DLLs in a bin folder when you deploy an MVC site
You can build MVC without Visual web developer... but why?