I have a solution for a mobile application I'm building - so far this consists of two projects:
Active5 years, 1 month ago
.NET Core On Mac - Building An ASP.NET Core App With Web API, EF, PostgreSQL And Running It On Docker. Download and follow the installation steps for.NET Core in MAC here. Visual Studio Code. This newly created project can be loaded into Visual Studio Code or use the command line to run the application. Restore, Build and Run the. All mobile apps need a backend, and Azure App Service can help bring that backend to life. From simple no-code backends with Azure Easy Tables to fully-customizable ASP.NET Web API backends, Azure has options to help you build a backend to power your mobile app. A Windows machine to run Visual Studio and write your project’s code. A Mac machine with Xcode installed to act as a build host. This doesn’t have to be a dedicated computer for building, but it must be network accessible during development and testing from your Windows computer.
The Web project makes calls to the WebAPI project. The plan is to create another project for a Windows 8 application, another for a WP8 app, etc.
This has worked alright while developing, but it has become quite complicated with CORS, deployments, etc (Web is served up from a different endpoint than WebAPI - two Azure Web Sites). My question is - when architecting a solution that's backed by a REST-ish API, when is it wise/unwise to split up the solution into multiple projects?
SB2055
SB2055SB2055
3,55520 gold badges72 silver badges153 bronze badges
![Example Visual Studio For Mac Building Backend Api Project Example Visual Studio For Mac Building Backend Api Project](/uploads/1/3/3/2/133274285/217627261.jpg)
2 Answers
Visual Studio
I always split the API and front-end into separate projects for a few reasons: https://walkbrown133.weebly.com/blog/ms-visual-studio-for-mac.
Front-end dependencies (jquery, knockout, angular..) make the api heavier than necessary. Sifting through code for the 'Other' project type can slow down development.
Source control can get a bit confusing when committing across two functionally separate projects within one project. If you change both the API and site within one commit, but then want to revert one of them to an older point in time (or promote them separately) this will become a headache.
By putting the projects together, you have to update shared dependencies all at once (upgrade to a new version of .NET?). IF your code for your API has dependencies on depreciated code, upgrading may be difficult and your website upgrade may be held back (or vise versa).
If they are within the same project, you can't easily publish just the API or Front-end. Normallythe API will be completed and stable long before you are done messing with the visual aspects of the site. You won't want to be held back by having to republish the API each time you make a minor site change.
Having both as the same project would require you to run both on the same webserver (and in the same application pool!). If you are going to have multiple sources hitting your API (usually the point of an API), then you wouldn't want the API degraded due to requests to the website. This goes both ways, if your API is being hit hard you do not want your site to become unresponsive.
Since they would run in the same application pool, they would also run as the same user. For security purposes you may want the API application pool to run as a separate service account that has integrated-auth access to your datasource. Then you could lock down the website user account and give it no access to external resources.
Since the MVC webapi template provides all the dependencies and configurations for a front-end, it may seem logical to put these together, but just because they made it easy doesn't mean it should be done that way. I usually strip down the front-end that is provided in this template and make it into a simple page to describe how to use the API.
In the end, MVC itself is all about separation of concerns and clean development. How to install python for visual studio mac. I would say that separating the project types follows this logic.
vesuviousvesuvious
2,0083 gold badges20 silver badges35 bronze badges
I cannot think of a technical reason to split a Visual Studio solution into a 'client' solution and 'service' solution. However, in my current work, we did split our solution to two because it was two separate teams working on the requirements. So, it is was purely an organiztional decision for us.
Ralph Allan RiceRalph Allan Rice
Not the answer you're looking for? Browse other questions tagged c#visual-studioazurewindows-phone-8asp.net-web-api or ask your own question.
Build cloud-connected cross platform mobile apps and games for iOS, Android, and Windows
Build cloud-connected cross platform mobile apps and games for iOS, Android, and Windows.
Visual Studio tools for Xamarin
Create rich native apps using .NET across iOS, Android & Windows. Share code across device platforms with .NET Standard. Share UI with Xamarin.Forms and XAML for maximum code reuse.
With 100% of the native APIs exposed, you have full access to device capabilities.
With 100% of the native APIs exposed, you have full access to device capabilities.
End to end developer services for mobile and desktop apps
Build great app experiences for iOS, Android, Windows, and macOS faster, with more confidence. Integrate globally scalable authentication, data management, and push backend services with just a few lines of code. Connect your repo and within minutes build in the cloud, test on thousands of real devices, distribute to beta testers and app stores, and monitor real-world usage with crash and analytics data. All in one place.
Interested in becoming a game developer? Check out our new course on the fundamentals of scripting and programming for game development using C#, VisualStudio and Unity.
Cross-platform game development with Unity and Visual Studio
Build your 2D and 3D games with the unparalleled Unity engine in Visual Studio–create once and target over 17 platforms, including all mobile platforms. Debug Unity from Visual Studio with the world-class Visual Studio debugger to set breakpoints and evaluate variables and complex expressions, and leverage all the great features Visual Studio has to offer to boost your productivity.
Cross-platform native development
Share, reuse, build, deploy, and debug your cross-platform C++ mobile code. Create projects from templates for Android Native-Activity applications, or create high-performance shared libraries to include in other solutions. You can also bring your existing C++ code to mobile platforms with minimal work. Use platform specific IntelliSense, validate code without building as you type, set breakpoints, watch variables, and deploy the application to devices (ARM, x86) and emulators alike.
Fast, Hyper-V-based, rich simulations
Deploy your cross-platform apps to different Android device configurations all from Visual Studio. It works with your Xamarin, Cordova, or cross-platform C++ projects. The Visual Studio Emulator for Android can be installed under “Individual components” with Visual Studio 2019. https://walkbrown133.weebly.com/blog/visual-studio-for-mac-can-i-program-in-c.
British Airways
British Airways delivers anywhere, anytime access to company news and updates to its 40K+ team members—on their device of choice. Visual studio for mac does not have addin manager.
Hewlett Packard
Hewlett Packard uses Visual Studio tools for Apache Cordova to rapidly build modern user experiences across multiple mobile platforms.gos.
Urban Refuge turns research into action for global refugees, making it easy to locate humanitarian aid with native Android and iOS apps.
Free, fully-featured IDE for students, open-source and individual developers
Professional developer tools, services, and subscription benefits for small teams
End-to-end solution to meet demanding quality and scale needs of teams of all sizes
Free, fully-featured IDE for students, open-source and individual developers
Professional developer tools, services, and subscription benefits for small teams
Example Visual Studio For Mac Building Backend Api Project Management
End-to-end solution to meet demanding quality and scale needs of teams of all sizes