Hello, I downloaded the template for .NET 4.6 with ASP.NET Core/Angular 2.
I am having problems compiling the app and trying it out. I posted about it here: #3513
So I've read the documentation and I am thinking that I could take the Angular 2 and publish it in a simple HTML website and take the ASP.NET Core (Web.Host) and host it on IIS under a subdomain smth like: api.mydomain.com or a different app on IIS and then let the Angular 2 app make calls to APIs hosted in the subdomain? Is that the story?
Thanks Bilal
OK, I've done the following on command line outside VS 2017.
Now, inside VS Error List, I see the following 12 Errors. Basically the errors are related to AppConsts.cs file.
Also, there are some properties in the dashboard.component.ts that are not defined.
Thanks
Severity Code Description Project File Line Suppression State
Error CS0006 Metadata file 'D:\Projects\Drc.App\aspnet-core\src\Drc.App.Web.Core\bin\Debug\netcoreapp1.1\Drc.App.Web.Core.dll' could not be found Drc.App.Web.Public D:\Projects\Drc.App\aspnet-core\src\Drc.App.Web.Public\CSC 1 Active
Error CS0117 'AppConsts' does not contain a definition for 'LocalizationSourceName' Drc.App.Application(net461) D:\Projects\Drc.App\aspnet-core\src\Drc.App.Application\AppAppServiceBase.cs 25 Active
Error CS0006 Metadata file 'D:\Projects\Drc.App\aspnet-core\src\Drc.App.Application\bin\Debug\net461\Drc.App.Application.dll' could not be found Drc.App.Web.Core(net461) D:\Projects\Drc.App\aspnet-core\src\Drc.App.Web.Core\CSC 1 Active
Error CS0006 Metadata file 'D:\Projects\Drc.App\aspnet-core\src\Drc.App.Application\bin\Debug\netcoreapp1.1\Drc.App.Application.dll' could not be found Drc.App.ConsoleApiClient D:\Projects\Drc.App\aspnet-core\test\Drc.App.ConsoleApiClient\CSC 1 Active
Error CS0006 Metadata file 'D:\Projects\Drc.App\aspnet-core\src\Drc.App.Application\bin\Debug\netcoreapp1.1\Drc.App.Application.dll' could not be found Drc.App.Tests D:\Projects\Drc.App\aspnet-core\test\Drc.App.Tests\CSC 1 Active
Error CS0006 Metadata file 'D:\Projects\Drc.App\aspnet-core\src\Drc.App.Application\bin\Debug\netcoreapp1.1\Drc.App.Application.dll' could not be found Drc.App.Web.Public D:\Projects\Drc.App\aspnet-core\src\Drc.App.Web.Public\CSC 1 Active
Error TS2688 Cannot find type definition file for 'jasmine'. <Unknown> 1 Active
Error TS2688 Cannot find type definition file for 'node'. <Unknown> 1 Active
Error TS2339 Property 'totalSales' does not exist on type 'SalesSummaryChart'. src (tsconfig project) D:\Projects\Drc.App\aspnet-core\src\Drc.App.Web.Host\src\app\main\dashboard\dashboard.component.ts 112 Active
Error TS2339 Property 'totalSalesCounter' does not exist on type 'SalesSummaryChart'. src (tsconfig project) D:\Projects\Drc.App\aspnet-core\src\Drc.App.Web.Host\src\app\main\dashboard\dashboard.component.ts 113 Active
Error TS2339 Build:Property 'totalSales' does not exist on type 'SalesSummaryChart'. Drc.App.Web.Host D:\Projects\Drc.App\aspnet-core\src\Drc.App.Web.Host\src\app\main\dashboard\dashboard.component.ts 112
Error TS2339 Build:Property 'totalSalesCounter' does not exist on type 'SalesSummaryChart'. Drc.App.Web.Host D:\Projects\Drc.App\aspnet-core\src\Drc.App.Web.Host\src\app\main\dashboard\dashboard.component.ts 113
Thanks. I will check that and get back to you.
Frankly I don't know! If possible to explain to me the possibilities in hosting ASP.NET Core + Angular.
Thanks
Thanks!
So eventually I need to place Angular 2 files inside the Asp.net Core app to be hosted under IIS?
Thanks. The documentation explains only how to deploy Angular 2, how about asp.net core? How can we deploy it in this case?
Thanks @ismcagdas :-)
Excuse my questions as I am starting with Core and Angular 2. I wanna move to those 2 technologies quickly.
Once I get a deployed version of the angular app, on IIS, how to place files inside an App?
Thanks
Always welcome and happy to share my little knowledge in this framework with others :-)
Yes this is the code:
public async Task<DataTable> GetPocPivotQueueAsync(int? tenantId, string firstOrLastName, bool? isActive)
{
return await Task.Run(() =>
{
return GetPocPivotQueue(tenantId, firstOrLastName, isActive);
});
}
public DataTable GetPocPivotQueue(int? tenantId, string firstOrLastName, bool? isActive)
{
// creates resulting Queue
var result = new DataTable();
SqlCommand cmd = null;
try
{
// prepare command
cmd = new SqlCommand("[dbo].[sp_GetPocInPivot]", (SqlConnection)this.Context.Database.Connection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@TenantId", tenantId.HasValue ? tenantId.Value : (object)DBNull.Value);
cmd.Parameters.AddWithValue("@Filter", string.IsNullOrEmpty(firstOrLastName) ? (object)DBNull.Value : firstOrLastName);
cmd.Parameters.AddWithValue("@IsActive", !isActive.HasValue ? (object)DBNull.Value : isActive.Value);
// Use DataTables to extract the whole table in one hit
using (SqlDataAdapter da = new SqlDataAdapter(cmd))
{
// fill the datatable
da.Fill(result);
}
}
finally
{
if (cmd != null)
{
// close command
cmd.Dispose();
}
}
return result;
}
Thanks Ismail. I can do it myself, I just wanted to know where to put the configuration. Can you let me know?
Also, I can send you a sample project like usual to check it out.