Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "dparizek"

+1 vote for adding Angular Universal

ok, I will add as PR to documentation repo on Github.

Followup, how I got it working here: [ #5117@f4847ddc-1fdd-497f-95b6-8e2350069a43])

Sharing this in case it helps... how I set up to use ASP.NET Zero on my mac (macOs High Sierra)...

Running ASP.NET Zero on Mac

Install Visual Studio for Mac: <a class="postlink" href="https://www.microsoft.com/net/download/macos">https://www.microsoft.com/net/download/macos</a> Install Visual Studio Code: <a class="postlink" href="https://code.visualstudio.com/">https://code.visualstudio.com/</a> Install .net core SDK: <a class="postlink" href="https://www.microsoft.com/net/download/macos">https://www.microsoft.com/net/download/macos</a>

From ASP.Net Zero download the ASP.NET CORE & Angular latest project version (5.4.1 at this writing) with .NET Core 2.0 as chosen framework and do not check one solution.

In the terminal, go to base_folder/angular and

yarn

(after installing latest: • yarn, in my case version 1.6.0 (<a class="postlink" href="https://yarnpkg.com/lang/en/docs/install/#mac-stable">https://yarnpkg.com/lang/en/docs/install/#mac-stable</a>, I used HomeBrew) • and I use nvm with node version 8.11.1 (<a class="postlink" href="https://github.com/creationix/nvm">https://github.com/creationix/nvm</a> • and angular cli (<a class="postlink" href="https://cli.angular.io/">https://cli.angular.io/</a>)

Next we open app in Visual Studio for Mac. For starters, I opened the Web solution only, under base_folder/aspnet-core

Set Web.Host project as Startup Project (right click on Web.Host project in Solution Explorer and you will see the option)

Build all.

I used a SQL database on Azure, set up in Azure Portal, and there got connection string like this, into base_folder/ aspnet-core/appsettings.json:

"ConnectionStrings": {
	      "Default": "Server=tcp:research1server.database.windows.net,1433;Initial Catalog={my db name};Persist Security Info=False;User ID={my_id};Password={my password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"},

Note you have to get your IPv4 address (e.g. <a class="postlink" href="https://www.whatismyip.com/">https://www.whatismyip.com/</a>) and in Azure Portal click on your database, then the "Set server firewall" button, then create a rule for your IP address (or range of addresses) and Save. Otherwise when you start-up you will see a Connection Refused error in the browser console.

Next we open app in Visual Studio for Mac. For starters, I opened the Web Solution only, under base_folder/aspnet-core

Set Web.Host project as Startup Project (right click on Web.Host project in Solution Explorer and you will see the option)

Now we want to get EF for dotnet. Initially, I used my window machine to do the first database update/migration/initialization on the Azure database instance. But now exploring how to do on Mac:

Go here: <a class="postlink" href="https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet">https://docs.microsoft.com/en-us/ef/cor ... cli/dotnet</a> and see Installing the Tools section.

Edit the Web.Host project file (right click project name and there is an Edit File option) and add following:
<ItemGroup> <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /> </ItemGroup>

Then back in Terminal:

dotnet add package Microsoft.EntityFrameworkCore.Design 
	dotnet restore

Check your dotnet ef install:

dotnet ef

And you should see a nice ascii unicorn:

Run the project in Visual Studio for Mac, it should take you to <a class="postlink" href="http://localhost:5000/swagger/">http://localhost:5000/swagger/</a> and that worked for me.

Then go to base_folder/angular and:

npm start

Wait, then navigate in browser to <a class="postlink" href="http://localhost:4200/">http://localhost:4200/</a>

And first it did not work for me because I had to set up the firewall rule for Azure, as above.

Then it did not work for me because the client side, according to the browser console, was trying to go to port 22742. But my server side was going to 5000 even though I did not set that anywhere, and appsettings.json seemed to only refer to 22742.

So using Visual Studio Code, I searched the angular project and replaced all instances of 22742 with 5000.

Then… it finally worked! (-:

There is no Package Manager Console in Visual Studio for Mac, so in Terminal you can Add-Migration:

dotnet ef migrations add InitialCreate

Or Update-Database:

dotnet ef database update

When you need to update service-proxies.ts then from angular directory after/while Web.Host project is up and running:

./node_modules/.bin/nswag run

For RAD tool on Mac, there is no Visual Studio extension to create the JSON input file, you create it manually. Which can be faster actually than field by field in GUI. Then run:

dotnet AspNetZeroRadTool.dll YourEntity.Json

(from <a class="postlink" href="https://aspnetzero.com/Documents/Development-Guide-Rad-Tool-Mac-Linux">https://aspnetzero.com/Documents/Develo ... -Mac-Linux</a>)

If you want to use VS Code on Mac without Visual Studio Mac, this is useful to set Startup Project... <a class="postlink" href="https://stackoverflow.com/questions/46705521/how-do-i-designate-a-startup-project-in-vs-code">https://stackoverflow.com/questions/467 ... in-vs-code</a>

Also the ability to have many to many relationship instead of just one to many.

and enums for string fields - that was removed?

Feature Request - where should we submit these?

for the RAD Tool it would be nice if permissions were grouped under the NameSpace chosen... so when viewing permissions each permission set (generated for an entity) would be nested under the NameSpace like for example how Settings and Organizational Units permissions are nested under Administration

Latest rendition of the tool is GREAT - Thanks ANZ team!

hi All:

With version 1.3 of the RAD Tool, on Windows in Visual Studio, for the Angular/Core style - prior to 1.3 it was working great, now it writes the back end stuff but NOT the .Web.Host/src/app/main/ folder of client side files.

Just me, or are others seeing this issue?

and with the Angular/Core version, where should we add additionalJS/CSS files/frameworks that we wish to add? I see .Web.Host/src/assets and a primeng folder under there.

If I want to add another primeng component, I add it there? and then add import to main.module.ts. Anyone know how to get primeng just parts as in the primeng folder? On the install page for primeng, it only details installing the full thing... <a class="postlink" href="https://www.primefaces.org/primeng/#/setup">https://www.primefaces.org/primeng/#/setup</a>

ok, in package.json the full thing is listed.

but aspnetzero angular app appears to only include autocomplete, datatable, and file-upload in assets folder. So better to include only what is needed - can anyone point me to how to install just parts of primeng?

or is there any documentation on dealing with js/css/font assets?

Thanks for your patience with my newbie questions!

Well can't I just modify the routing such that the logged in section is mybrand.com/app and then use a controller to make myself an index page that does not require login at mybrand.com (and any subdirectories that are not /app) ?

What files do I need to modify to effect that routing setup change? I don't need any login or shared login on the non /app pages

What is the logic behind having multiple domains for your product/SaaS offering???? Why would you want more than one domain name for your business? If customers go to MyBrand.com, then they also have to remember MyOtherURL.com too??

Why the decision to make the public landing pages completely separate and hosted at separate URL? What business use does this serve??

Before, with the Angular1 and MVC 5 version, you have your landing pages with no login required, and then when you login, the SPA lives under /Application#

Then only one domain name to remember, to brand, to backup, to deploy, and to pay for hosting on.

What about the current Core MVC + jQuery solution - why could it not have landing pages at base url mybrand.com? - and put all the admin/login required part - under mybrand.com/app ??? What would someone need to change to put it back to working like that??

I see this happened with version 4.1.0 of ASP.NET Zero:

V4.1.0 (2017-06-23) Public web site is moved to a separated project (and authentication integrated to the main application).

Possible to get guidance on how to get back to not separated project?

Showing 21 to 30 of 71 entries