Base solution for your next web application

Activities of "justinp"

I got it all working and deployed to Azure. Just to be super-clear to anyone getting started with ASP.NET Zero v3.1, and the latest version of Angular CLI, here are the steps. All the previous steps for deploying the API are still valid, so this just applies to getting the angular portion deployed and working in Azure.

  1. Make sure you have the latest version of Angular CLI (@angular/[email protected]) by running 'npm list -g.' If you are having trouble, use the commands in my previous post to ensure you uninstall globally and that the cache is clear before installing the latest.

  2. Download your project files from ASP.NET Zero and extract them to wherever you will be working with them.

  3. From within 'angular' folder, run 'npm install' from a command prompt. This will create the 'node_modules' folder in side the angular folder with all the dependency files for the project.

  4. Open and modify the "environments" section of the angular-cli.json file according to this error message (you will get this error message if you run 'ng build --prod,' so if you forget, it will remind you):

To migrate angular-cli.json follow the example below:

Before:

"environments": {
  "source": "environments/environment.ts",
  "dev": "environments/environment.ts",
  "prod": "environments/environment.prod.ts"
}


After:

"environmentSource": "environments/environment.ts",
"environments": {
  "dev": "environments/environment.ts",
  "prod": "environments/environment.prod.ts"
}
  1. Run 'ng build --prod.'

You should now have a folder inside the 'angular' folder called 'dist' with 22 files and an assets folder, and can continue with the previous posts steps 9-11. The web.config file mentioned is now part of the files in the package, but doesn't get moved into the dist folder.

  1. Connect to your azure website's ftp and transfer files under dist folder to "/site/wwwroot/" of your azure website.
  2. Configure appconfig.json under "/site/wwwroot/assets" on your azure website.
  3. Add a web.config file under "/site/wwwroot/" which has below content. This will be included in our next release as well.

To configure the appconfig.json metioned in step 10, open it and change it to:

{
    "remoteServiceBaseUrl": "http://your-api-url.azurewebsites.net",
    "appBaseUrl": "http://your-angular-ui-url.azurewebsites.net"
}

You should now have a working instance deployed to Azure.

Enjoy.

Answer

If the UI project can't find the back-end (API Project), then you'll get the forever spinning. Try to run both projects at the same time.

Downloaded the new version (3.2) and ran into an issue running the APIj project: "InvalidOperationException: Could not find 'UserSecretsIdAttribute' on assembly 'ApolloEHR.Web.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."

However, I ran the project without running the database upgrade. So I circled back and read the documentation:

ASPNET ZERO MIGRATOR APPLICATION

AspNet Zero solution includes a .Migrator (like Acme.PhoneBook.Migrator) project in the solution. You can run this tool for database migrations on development and production (see development guide for more information).

However the development guide linked to does not contain any information on the Migrator project. Either the link needs to be fixed or the documentation is missing or both.

I went to upgrade to 3.2 and found this information in the FAQs. However, the Github project is just for documentation, not the code itself. Where is the code repository, how do we access it and how do we merge the changes with the previous code branch?

I just get a 404, even when logged in.

HOW TO UPGRADE EXISTING APPLICATIONS WHEN A NEW VERSION IS AVAILABLE? We can split updating to 2 parts:

1 - ASP.NET Boilerplate (the framework) and module-zero (base domain logic for user, role, tenant... management). They can be easily updated since they are distributed on nuget. Here, a list of all nuget packages:

<a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Nuget-Packages">http://www.aspnetboilerplate.com/Pages/ ... t-Packages</a> <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Zero/Nuget-Packages">http://www.aspnetboilerplate.com/Pages/ ... t-Packages</a>

New releases generally are backward-compatible. If there is a breaking change, we add it to relase notes and document how to migrate. You can upgrade these nuget packages even after your license period ends, since they are open source. So, upgrading this part is easy. Just update nuget packages.

2 - AspNet Zero - the startup template: UI views and application services

This part is not developed as a 'closed' framework/library. Because different companies have very different needs and you will want to extend/change UI upon your needs. That's why we call AspNet Zero as a starter kit/template: All source codes of ASP.NET Zero is on your hands, you can freely modify it upon your needs.

In most cases you don't have to upgrade if you are happy with your solution. Even you might built the same feature yourself before us. If you like new features, you should adapt changes to your existing solution. In this case, Github repository will help you much (github.com/aspnetzero/aspnet-zero, requires purchasing ASP.NET Zero to access). You can compare releases and copy changed parts to your solution. For example, assume that we enhanced Audit Logs page with new features and you want to get these new awesome features. If you did not change this page, you can directly override your page and related classes. If you did change it, then you can see changes on Github and you can merge changes to your code. We also advice you to review each commit to check if it's also needed for you. Because some of they can be bugfixes.

  1. Downloaded v3.2 and opened the API .sln.
  2. Modified the connection string to point to a database (used this same database previously, so it should work).
  3. Went to root directory of entity framework project and ran 'dotnet ef database update.'
  4. Get the following error:
Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'D:\Users\Justin\Downloads\ApolloEHR\aspnet-core\src\ApolloEHR.EntityFramework\project.json'.

I'm getting this error when trying to run the API project.

InvalidOperationException: Could not find 'UserSecretsIdAttribute' on assembly 'ApolloEHR.Web.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Could not find 'UserSecretsIdAttribute' on assembly 'ApolloEHR.Web.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Microsoft.Extensions.Configuration.ConfigurationExtensions.AddUserSecrets(IConfigurationBuilder configuration)

Microsoft.Extensions.Configuration.ConfigurationExtensions.AddUserSecrets(ICon

figurationBuilder configuration)

Question

I paid $850 USD for this product that is supposed to help speed up development. However, I spent the first week resolving an issue with the Angular UI to get the project to run with the release candidate Angular CLI (nothing suggested in the forum or sending in the code helped). Now a new version comes out (3.2) that is supposed to address exactly what I solved (working with the latest Angular CLI). No one told me that it was being fixed in the next release which would be out in days. That would have saved me a lot of effort. Solving the issue was a waste of my time when I could have focused on other things. That is bad customer service and support.

Now, I download version 3.2 and the API project won't even run. I've got all kinds of issues (posted throughout this forum, listed below) and something very simple, like running the EF commands to get the project to deploy the databases doesn't work.

  • Version conflict detected for xunit.extensibility.core. ...
  • Version 3.2 EF Error: Could not find file project.json
  • InvalidOperationException: Could not find 'UserSecretsIdAttr
  • Github project is missing...
  • Migrator Project Documentation is missing...

I don't want to work another week to solve these issues that shouldn't exist. I've lost two weeks when I should have been learning how to leverage all the multi-tenant capabilities. I don't have time to solve problems with other people's projects, and documentation is missing.

I want a working version of the software I paid $850 for now, or I want a refund.

  1. Downloaded v3.2.
  2. Extracted and opened api .sln.
  3. Tried to restore packages, but get this error:

Version conflict detected for xunit.extensibility.core. ApolloEHR.Tests (>= 1.0.0) -> xunit (>= 2.2.0-beta5-build3474) -> xunit.core (>= 2.2.0-beta5-build3474) -> xunit.extensibility.core (>= 2.2.0-beta5-build3474) ApolloEHR.Tests (>= 1.0.0) -> xunit.extensibility.execution (>= 2.2.0-beta2-build3300) -> xunit.extensibility.core (>= 2.2.0-beta2-build3300).

Solution:

  1. Went to NuGet package manager. (Right-click solution, and go to Manage NuGet Packages for solution)
  2. You should see updates above and an update for xunit.
  3. Install the udpate.
  4. Re-run Restore NuGet Packages.

Thank you for the reply.

Yes, I'm switching to VS2017 and aware that some things are different (project.json vs global.json) and working through that. However your suggestion did not resolve the issue.

The following packages that are prompted to be updated when the solution is opened, which does include the one you mentioned.

xunit -> v2.2.0 xunit.extensibility.execution -> v2.2.0 xunit.runner.visualstudio -> v2.2.0 Microsoft.NET.Test.Sdk -> v15.0.0 Migrator.EF6.Tools -> v1.1.0

After upgrading and restoring the packages, I did the following:

Set Web.Host project as default Built the solution

You mentioned using the Migrate tool. As I mentioned in this post the documentation referenced is missing: [http://forum.aspnetboilerplate.com/viewtopic.php?f=5&t=5370])

Running console from inside folder: No executable found matching command "dotnet-ef"

Running from Package Manager Console: PM> update-database The EntityFramework package is not installed on project 'ApolloEHR.EntityFramework'.

So I checked, and just like the error says EntityFramework wasn't installed! Installed it, then get the errors about the project.json missing.

There should be either both clear documentation on the workaround using Migrator, and updated documentation on using EF CLI. There are neither that I can find, but if you can point me to it, I'd be grateful.

Showing 11 to 20 of 79 entries