How to config Service and UI view - aspnetboilerplate

Reference to my previous question: Can't compile the project. Missing so many files
I am very new to .NET core version. So I have so a few questions need someone to guide me to a quick start.
There are 2 templates version for ASP.NET core 2.0; .NET core and .NET full. Does it mean if I choose the .NET full version, I still can use 3rd party DLL such as iTextSharp or EPPlus version, doesn't it? 'Cause I have read that with .NET core, all 3rd party DLL without .NET core support could not be used in the project.
From the download template, it contains 2 main projects, one is .NET core service and another is angular UI view. Currently, it set to localhost for all API calls. Because I run the window server in my VM and run the client on my host so I need to set the client to look for the service on my VM via IP address. Which file do I need to config?
Related to Q2, how to config the .NET service to run in production mode and install into IIS server?
Thx in advance for all comments and suggestions.

Answer to the second question;
There's a config file in src/assets/appconfig.json
You can change those values...
remoteServiceBaseUrl: Used to configure base address of the server
side APIs. Default value: http://localhost:22742
appBaseUrl: Used
to configure base address of the client application. Default value:
http://localhost:4200
appBaseUrl is configured since we use it to define format of our URL. If we want to use tenancy name as subdomain for a multi-tenant application then we can define appBaseUrl as
Aspnet Zero Angular Getting Started
PS: Apart from the framework configuration; be aware that connecting something in VM is another discussion. You need to set some settings like Bridged Networking... You can figure it out in the related VM's board.

For point 1 you can refer this post.
For Point 2: You can host your service application on Azure or IIS so
that you can consume your service from other PC.
For Point 3, Its pretty well explained here.
Additional: If you want to deploy Angular application, you can refer Deployment of Angular Application
You can also refer src/assets/appconfig.json for required configurations.

Related

How to host ms bot created in c# or composer in windows service?

We must use C# MS bot in windows service. How to implement it in .Net core for MSBot SDKv4?
All samples using IIS/Azure App service as hosting platform.
They're aren't any examples or samples that show how to explicitly do this. But you should be able to follow articles such as this or this and then tweak as needed. It shouldn't be much different than hosting any other asp.net core application.
The two points to make sure and cover are:
Make sure that the bot/application is configured (whether in appsettings.json or otherwise) so that it has the right configuration data. Specifically appid/password
Ensure the endpoint can be hit by the connector/channels.

Kentico Media Library not syncing with MVC project

I'm using Kentico 9 with MVC. When I add a image to the media library it is not copied to the MVC application. I am using the default media library location which resolves to ~/site/media but the image is only accessible from the admin domain. admin.site.com/site/media/image.jpg and not from site.com/site/media/image.jpg.
For the image to be accessible, I have to manually copy the images to the corresponding folder.
My admin and MVC site are hosted on the same server using two different IIS app pools. However, we plan to separate these in the near future, so its important that this synchronization works correctly.
Under Web Farms, I have only one active server.
Both web.config files have the same CMSHashStringSalt values.
based on the Documentation:
By default, content of media libraries is synchronized via web farms and duplicated between Kentico and your MVC application.
EDIT:
What is the best practice for configuring media libraries with MVC?
The fix was simply adding <add key="CMSWebFarmServerName" value="MVCApplication"/> to the MVC application
SOURCE:TLDR
If you plan to run the Kentico and MVC applications on the same domain (for example, distinguished by port numbers and run in different virtual folders), you need to manually assign unique server names to the web farm servers. To set a web farm server name, see Step 5 in Configuring web farms manually.
Since these sites are hosted on the same machine, i needed to specify a unique server name.
My understanding of the MVC setup is that you should either have two servers setup manually in your web farm or have the web farm set to auto. As you only have one, there is nothing to synchronize. That you only have one server in your server list makes me think that the synchronization is not going to work. If your web farm is set to auto, perhaps try to configure it manually.
Do you have the Admin and MVC running as two site under IIS pointing to the same database? Also, do you have the license key with 2 servers modifier? (you will need to request that from your sales rep)

asp.net web api self hosting / owin / katana

There are multiple question I have around self-hosting
Self Hosting Nuget
There are 2 nuget which provide self hosting : Microsoft.AspNet.WebApi.OwinSelfHost and Microsoft.AspNet.WebApi.SelfHost, so does microsoft have 2 implementation of self hosting?? or they are same??
Owin or Kitana
the name of nuget is Microsoft.AspNet.WebApi.OwinSelfHost has OWIN, but as far as I read Owin is an interface and Kitana an implementation, what is the name of the nuget for implementation??
Hosting in Production
I have managed to run the example by creating a console. But when deploying to prod, how to deploy?? Run the exe and keep running console, cant do that. what if somebody closes that console. So should be hosted as part of windows service?? or Is there any other way?
NuGet package here clearly states this.
Microsoft ASP.NET Web API 2.2 Self Host 5.2.2 This is a legacy package
for hosting ASP.NET Web API within your own process (outside of IIS).
Please use the Microsoft.AspNet.WebApi.OwinSelfHost package for new
projects.
Anyways, SelfHost is old and is based on WCF stack. OwinSelfHost is new and is based on Katana (name is Katana and not Kitana, BTW).
For production hosting, console app is not practical. You will need to create a Windows service. Take a look at this.
after working on months with webapi/owin I got answers to above questions..
The package to use
Microsoft.AspNet.WebApi.OwinSelfHost
and for hosting better to use topshelf
Topshelf
please read this blog post

Windows 8 Application Packaging

I am working on creating a Windows 8 application. UI is using HTML5. Using WinJs I am calling a WCF service that returns a datatable used to build out the UI. All that is good.
I would also like to create a Window Service that gets packaged up with the application, so when someone download/installs it gets unpackaged and the windows service is started/executed. Is this type of configuration possible?
The WCF service today is a web service, but I would like to make it a windows service. The idea is to make everything self contained. This would allow me to make it available in the Microsoft Online store - if I wanted to go that route.
Windows 8 Applications don't support installing services. The best you can do is install a service separately.
Your WCF service should be decoupled from your app and most probably running on a different machine! I am pretty sure that the they are not going to allow you to install or run services in context of a Windows Store App.
Installing a windows service is not an ideal approach for any Windows 8 application. I understand that you want to make everythig self contained but, why as a WCF local service then? Why don't you consider having it has a data access layer in your app itself? Just a thought.
REGARDING CLIENT SIDE
Web services are separate projects and separate deployment models. You can have one Visual Studio project for the Windows 8 client app and one project for the Web Services side.
Windows 8 apps have several options for saving persistent data, such as endpoints for consuming web services.
There are several consideration when storing Windows 8 application data, such as the location of web services to be consumed.
Windows 8 Application data also includes session state, user preferences, and other settings. It is created, read, updated, and deleted when the app is running.
There are 3 types of dimensions to consider. The system manages these data stores for your app:
(1) local: Persistent data that exists only on the current device
(2) roaming: Data that exists on all devices on which the user has installed the app
(3) temporary: Data that could be removed by the system any time the app isn't running
As a developer, you concern yourself with a couple of objects to persist application data:
The first container object is ApplicationDataContainer. The other is ApplicationData. You can use these objects to store your local, roaming, or temporary data.
REGARDING SERVER SIDE
Your Windows 8 Client app will consume http-based web services.
Most developers deploy web services to the cloud to be consumed by iOS, Android, Windows, and other server side services.
Windows Azure is a cloud offering that makes exposing services to clients very simple.
You can leverage either cloud services for robust solutions or the lighter weight Azure Web Sites.
You can typically choose either of these two project types to create web services:
(1) Windows Communication Foundation WCF; or
(2) ASP.NET Web API, which is included with MVC version 4.
WCF has been around longer and has historically been the primary choice for developers when it comes to exposing services.
Microsoft's more modern concepts about web services relate to the ASP.NET Web API, which truly embracing HTTP concepts (URIs and verbs). Also, the ASP.NET Web API can be used to create services that leverage request/response headers, hypermedia, etc.

Deploy ASP.Net site to windows server

I have been developing an ASP application which I have almost finished. It accesses a SQL database on a Windows sever on AWS. I would like to deploy my application to AWS though.
Does anyone have any suggestions about how I should do this?
Refer to the Deploying an asp.net application thread that contains all necessary information and step-by-step instructions on how to accomplish this task.
If you are deploying an MVC application, check whether the hosting provider provides the support for MVC hosting. Just right-click on the solution and select Publish. Then copy the files into the hosting space.

Resources