Silverlight OOB App and Web Service in same Solution - visual-studio

I'm using vs2012 and have created a Silverlight 5 out of browser application that talks to a MVC 4 webapi web service for its data.
With both projects in the same solution I can successfully fire up and test the silverlight application with the web service if I have the web service set as the startup project and have the application running in the browser and embedded in a view on the MVC web service site. If I set the silverlight application as the startup application so that I can run it out of the browser like the user will, then the MVC site doesn't get started and the web service isn't available to connect to.
Is there anyway to have both projects running in the same instance of visual studio, but have the silverlight app run out of browser?

Try this:
Right click on solution from Solutin Explorer and select Properties. Then select the Multiple startup project option inside Common Properties/Startup Project and set both as 'Start'. Close and Start Debug again.

Related

How to publish MVC3 razor with WCF service on IIS 7.5

I have created a service-oriented MVC3 application in Visual Studio 2010. I have used layered architecture for my application. It has a separate project for WCF Services,and separate projects for BLL and DAL, and also one for Entities. Now I want to publish my MVC application on IIS 7.5. I have Windows 7 Home Premium, and I use SQL Server 2008 R2 for my database. How can I publish it in IIS 7.5?
Note: I have created library projects for Entities, BLL, and DAL and use MVC3 for web project and WCF Service Application for WCF services.
I already tried to publish it by using this tutorial, but when I run the application in a browser, it does not load my Javascript, jquery and CSS files, and it give Network error 404 file not found.
Use, #Url.Content("~/blah/blah") to convert the relative path to an application absolute path.

Deploying ASP.NET Web API to IIS 7

I developed a Web API and am trying to deploy it to my web server. Is there a forward steps to do that
Is there a forward steps to do that
Yes, right click on the web project and then on the Publish ... button in the context menu. Then follow the steps. Here's an overview of the process on MSDN that you might go through.

Is it possible to add a console application in a WCF service solution?

I am currently creating a WCF service application using Visual studio 2010.
Is it possible to add a console application as a new project in the same WCF service solution?
Yes it is. Just add a Console application project to your solution.

Stop ASP.Net Development Server spinning up when using Azure Emulator

I am using The Azure Emulator for test deployment of an ASP.NET Web API application. When I run this I notice that the asp.net dev emulator also runs. As this does not seem to be needed, is there a way to stop it from spinning up?
There are couple of things to understand with Windows Azure ASP.NET Web role application:
When you have your Web Role set as "Startup Application" or you run ASP.NET web Role application only, you you will see the ASP.NET site runs at http:\localhost:XX this is because you are running your web application directly in IIS without any relationship with Azure Compute Emulator.
When you have your Windows Azure project set as "Startup Application" or you launch your Windows Azure application directly, in that case your ASP.NET web application will run within Windows Azure Compute Emulator. In this scenario the Compute Emulator will start if not running and if running then the ASP.NET web application will still run with IIS however due to virtual load balancer scenario you will see the ASP.NET web application is running at http://127.0.0.x:XX.
So depend on how you launch your project within your solution you will see different execution. When compute Emulator is running you can open its UI to understand how your different instances are running.
Finally based on your above requirement it seems you just want to test your application in IIS only so if you just set your ASP.NET web role to "startup project" you will not see compute emulator activity.

VS2010 - Debugging a silverlight 4 OOB with breakpoints in the WCF services

I created a silverlight 4 app , and chose to host it in a ASP.NET Web Application.
I added a Silverlight-enabled WCF Service to the Web Application Project.
The Web Application project is now set to be the startup project.
This way every thing works fine and I can stop at breakpoints in the WCF services in the Web app project, and also stop at breakpoints in the silvelight project.
In the silverlight project properties, I changed it to be an OOB. This causes the startup project to automatically jump to the silverlight project. OK, so now when I debug the silverlight app it's opened OOB, but now I cant put breakpoints in the WCF services in the Web app project (Although the silverlight client can communicate with the web app project) . So I changed the startup project to the Web app again. But now the silverlight app doesn't start as OOB.
How can i debug in the WCF services, and run it OOB at the same time ?
(My app is designed as an OOB, so it's important for me to develop it that way).
First, You have to set a breakpoint on your client side, right before you call a service operation.
Second, set another breakpoint inside the service method on the server side.
Now, when you start debugging and hit the first breakpoint, attach the dev server process to the debugger by doing the following steps:
click Debug - > Attach to process
select the Webdev process and click attach.
now when you continue to debug, you will be able to debug your service as well :)
When you start debugging, you should go into Visual Studio and manually attach the debugger to the development web server (Debug->Attach to Process...). This step is not done automatically when debugging OOB.

Resources