ASP.NET ZERO 5.5.2 on mac

So! After a whole week of fiddling and pulling my hair out, i finally managed to get ASP.NET ZERO working on my mac OSX development environment.

I'm going to list the steps i did to get this to work: (don't build or run or debug anything until i list the step)
 

Do the next step before opening the solution in Visual Studio, it will try to restore the packages but it will fail.
Clean the *.CSPROJ files in the aspnet-core/src folder to only target the .net core 2.1 framework, because visual studio for mac doesn't like that the original projects target multiple frameworks.
change all the occurences of <TargetFrameworks>net461;netcoreapp2.1</TargetFrameworks> into <TargetFramework>netcoreapp2.1</TargetFramework>
Remove all the conditional <itemgroup> nodes in all the projects: <ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
Open the solution in Visual Studio Mac - it should restore the packages (make sure you have the .net core SDK installed)

Set the web.host project as the startup project (rightclick , ...)

Apply the crack as stated in the README file:
Replace the nuget package that is installed locally with the cracked version
The nuget packages can be found in ~/.nuget/packages
Edit your connectionstrings to whatever values you like... I had to edit 9 appsettings.json files 

Remove the <Target Name="PreBuild" AfterTargets="PreBuildEvent"> node in the Web.Mvc.csproj file
No idea why this had to be removed, but it kept crashing on the dotnet bundle clean command
Remove all code references to External Authentication, this means that you wont be able to use the facebook, google,... login functionality. Please let me how if anybody got this work!
file angular/src/account/login/login.service.ts : line 84-100 and line 195 - 314 , comment out the content of init(): void
file angular/src/account/login/login.component.ts : line 67
file angular/src/shared/service-proxies/service-proxies.ts : line 7254 - 7364
file aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Mvc/Views/Account/Login.cshtml : line 57 - 68
Uncomment in file aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Core/Controllers/TokenAuthController.cs : line 434 - 455
I also removed/deleted lines 580-584 , sometimes this helps, but usually it didn't cause any problems
Build (not run/debug) the solution in VS - Try and fix any errors you still encounter

Start up your terminal and browse to the EntityFrameworkCore folder in aspnet-core src folder
run : dotnet ef database update --verbose
This should create/populate your database with initial values
Cool! Now you can run the Server app! Go to VS and run/debug the web.host app. The first time this can take a minute or two before the app is running. Check your application output window for the status.
My installation started serving the app at localhost:5000. Browse to localhost:5000/swagger to check the API status
Now let's fire up the angular client app :

In Terminal, browse to the Angular folder and run yarn
Make sure you have Homebrew installed so you can install Yarn if you haven't already ( google will help you with that)
Change the server port number in angular/src/assets/appconfig.json from 22742 to 5000
I replaced all occurrences in all files of 22742 to 5000 just to be sure
In terminal, run npm start and if all went according to plan, enjoy your working instance of ASP.NET ZERO
 

WX:dwhong2018

猜你喜欢

转载自blog.csdn.net/john_dwh/article/details/81567812
今日推荐