Web Forms Project Consuming Web Api 2 Project in debug mode - visual-studio

In my solution, I am creating new Web Api 2 project to migrate my services in another Web Forms project.
My question is:
Is there any way (best way) to use my new Web Api project in my Web Forms project when I am debugging?
Actually I have to start my Web Api (without debbuging), after, I am able start my Web forms and use my web api. It is unproductive.
I have tried to make this works with Pre-build event, but i do not know if I did something wrong.
PS.: I do not need the both projects running in debug mode.

Related

ASP.NET Core Web API vs ASP.NET Core Application

First off, I apologise if this is a trivial question but I am getting so confused by the information I am reading. I have put off posting on here as I feel my question is too broad but I can't find a definitive answer. I am a C++ developer by trade but I am wanting to get into web development.
My end goal is to have a web API that is consumed by both a web app and mobile app. I want to get the structure nailed first by developing an web API and web app and then expand it to a mobile platform later on.
My aim is to have 4 separate sections - Database -> WebAPI -> Web App
-> Mobile App
all of which are protected with username/password etc.
I have decided to use ASP.NET Core but when creating an application I am given two options in visual studio - ASP.NET Core Application or Web API. I have tried creating a Web API and a separate Core Application but can't work out how to call the web API. I have also tried creating a Core Application as it seems like I should be able to do everything I want in one project but I am worried that the Web API won't be separated enough to be able to call from a mobile app.
I will be working with a database containing sensitive information so obviously want to protect access to the Web API and Web/Mobile app. I have been watching courses on Pluralsight about Identity but I have read that it doesn't work well with Web API's.
Basically I am getting extremely confused when in my mind my end goal should be relatively simple to achieve. If anyone could give me any pointers as to what technologies I need to use would be fantastic.
ASP.NET Core WebAPI is specifically designed for building REST-ful services.
ASP.NET Core Application is used to create web applications that returns both views and data (it's an analog of Asp.NET MVC from standard Framework).
Which to choose is really depends on kind of WebApp you are going to use. If you plan to use some SPA framework, you don't need mechanisms to generate views on server side - WebAPI is a great choice, otherwise choose Application. Here you can find more details on differences.
As of security concern, there no issues with WebAPI. It provides a lot of mechanisms to secure your API and restrict access to methods based on user's identity. Please look at this article as an example.

How to send and receive data from ASP.NET server to Android

I want to make a Biometric e-voting system.A voter register and cast vote through android app and all other activities are handled in asp.net server.here i want to know how send and receive data from ASP.NET server to Android
Simply put:
Set up RESTful API in ASP.NET server. And in your Android app, consume it with Java (native app) or JavaScript (html app).
Just create an ASP.net Web API project, create Web API controllers and write methods in it and call it from your Java code in Android.
Here's a sample which could be useful to understand what to do:
http://hintdesk.com/how-to-call-asp-net-web-api-service-from-android/

Solution for implementing Facebook-like notification

I'm having a system which contains a Unity scene( social network view), which is connected to a DLL file written in C#, and this file is responsible for connect to WebAPIs hosted by ASP.NET WebAPI, which is the social network service.
I'm trying to implement facebook-like notification service. What is the possible solutions/technique here to implement this feature?
I just read some example likes socket.io or SignalR but it seems that those things don't support C# client( the DLL) as well as ASP.Net WebAPI
My app. is something like a Whatsapp chat app. plus e-bay online shopping. It is mainly consist of 1 solution with 3 projects using Visual Studio 2015 Community RC.
project 1 is a JavaScript Cordova project with one and only one index.html file which is hosted in IIS 8.0 and is also capable of hosted as a native app. of an Android phone or iPhone. So the clients can use any pc desktop browser, or mobile browser to use the app. Or can install the app. from app stores of Android or iPhone.
project 2 is a Visual Basic Web Services hosted in IIS which contains all the backend business logic and connect to the ms sql server.
project 3 is a C# Signalr Server Winform, which can notify the clients if there is any new message.
for example, client X send a message to client Y:
index.html of X call VB Webservices to store the message in sql.
index.html of X call Signalr Server.
Signalr Server call Index.html of Y to notify there is a new message.
index.html of Y call VB Webservices to read the message.
You may wonder why I don't simply use signalr to send the message to Y, as the message is complicated, it can be a text or text with images or product information with product images.
As stated the index.html can be hosted inside the phone as native app, I also need to enable Cors in the webservices as well as the signalr.
of course the signalr Server can also call the VB webservices directly if needed.

How to convert an existing ASP.NET Web API to Azure Mobile Service?

Recently announced at Microsoft Build is the ability to convert an existing ASP.NET Web API to an Azure Mobile Service. I was curious as to if anyone has successfully done this yet, and the steps needed to do so.
Things I've tried thus far:
Added the Azure Mobile Service .NET Backend & Azure Mobile Service -
Entity Framework Nuget Packages to my existing ASP.NET Web API
project.
Resolved an issue with OWIN and AMS(ZUMO) conflicting Startup.cs assemblies.
Ensured the ASP.NET Web API compiles locally, and published as an Azure Mobile Service.
However whenever publishing, it seems I only get a runtime error on the server.
Here was the best example of potentially doing this: http://channel9.msdn.com/Events/Build/2014/3-623
Secondly I've looked a bit into just running the OWIN pipeline via: http://www.strathweb.com/2014/02/running-owin-pipeline-new-net-azure-mobile-services/
I know that this is in a preview mode, but figured some document trail would help!
Can you try adding your existing WebAPI assets to Mobile Services project you create from VS? This will make sure all the right things are wired up. Also, check the Logs tab in the portal for any clues.
This should help..
http://blogs.msdn.com/b/azuremobile/archive/2014/04/10/creating-an-azure-mobile-services-net-backend-from-scratch.aspx
Thanks
Supreet

What's the best/easiest way to use Ajax with a Sharepoint 2013 web part?

I'm developing a Sharepoint 2013 WebPart. (We're using web parts rather than the new app model because we're leveraging a large amount of existing web parts from an older project).
For my portion, I have some javascript objects I'd like to send back to the server using AJAX, because I'm used to developing with MVC and the Web API and that's what I'm used to. What's the easiest/best way for me to do this?

Resources