View of Blackcomb mountain

A winter wonderland holiday in Whistler, BC

Last Christmas, we went to Whistler, BC. This is a beautiful place north of Vancouver, popular for skiing, snowboarding, and mountain biking during the summer. It was our first time there, and we loved it.

Last November, my family and I spent Thanksgiving in NYC. This is where my two older kids live now. We took a plane from Seattle, WA, and after six hours and 3 mediocre movies, we arrived in New York’s John F Kennedy airport. During our time in NYC, my family and I talked about the idea of spending Christmas in Germany. My wife and I had been exposed to a few YouTube videos showing the Christmas markets in Germany, and we were enthusiastic about going there.

Thanksgiving parade balloon

Unfortunately, COVID happened, and as with many plans in the past two years, we decided to avoid air travel. The news about the Omicron variant and how some European countries had started to impose rules for travelers again is why we chose to avoid going there.

Whistler was not the first place we thought of. We toyed with the idea of visiting Toronto, Montreal, Quebec City, or staying home in Seattle. But after looking at the cost of plane tickets to go to eastern Canada and the possibility that COVID travel restrictions could arise again, we decided to stay on the West coast and avoid air travel, but for real this time.

After looking at a few places, I ran into some travel videos about Banff in Alberta, Canada. But then again, the distance is the reason we didn’t go there. A bit too far for winter driving. What else could we do? We liked the idea of going to Canada, just not driving for too many hours, and we definitely wanted to avoid air travel. This is where Vancouver comes into the picture.

Since we live in Seattle, WA, visiting Vancouver is a must. It’s a great city, they have great food, and it’s very close to us. Vancouver is a 2.5-3 hours drive from Seattle. That’s close enough for a weekend or even a day trip. We have been to Vancouver many times, so we looked around this city to find out what else we could visit in the area. As soon as I started looking for places to visit near Vancouver in winter, Whistler came up.

Whistler is a town north of Vancouver, home to Whistler Blackcomb, one of the largest ski resorts in North America. I did some research, and after a few days, decided to make a reservation at the Fairmont Chateau Whistler hotel. After reading online reviews and viewing photos of this place, the decision was easy. It looked magical and almost perfect for a Christmas holiday.

View from hotel window in Whistler

Two of my kids had skied before, and the rest of us had not. So I booked a ski lesson for the family… when in Rome. To be honest, not all of us were excited about the idea. In fact, I almost canceled the ski lesson just minutes before it began. The weather wasn’t great that morning, and it felt like a good excuse to cancel the whole thing and instead do something “easier.” Oh, boy, am I glad I didn’t cancel it.

We got to the Fairmont Hotel in Whistler the day before Christmas Eve. Before that, we spent a few days in Vancouver, just eating and doing some last-minute shopping. When we arrived at Whistler, the mountains, the snow, the hotel, everything was exactly how we had imagined it. It is a winter wonderland.

View from hotel window in Whistler

The hotel was tastefully decorated, it felt warm, and everything around it was beautiful. Our rooms were perfect, and the ambiance was what we were looking for. It felt like a Christmas holiday from a movie, but it was real, and we were living it.

After our first day there, we found out about the village. The hub of Whistler is a compact, chalet-style pedestrian village at the base of Whistler and Blackcomb mountains. This place is full of shops, restaurants, and amazing views all around since it’s at the base of two beautiful mountains.

We had a great time, and I think we’ll be back there again. Perhaps in the summer to check out the area without snow. In Whistler, there are many places to stay like hotels, cabins, chalets, etc. But you have to book them with time in the winter season. It’s a popular place for skiers and snowboarders.

If you go there during the winter, I recommend the ski lessons if you are not familiar with this activity. For us, it was a great way to spend the day together, at the mountain, and learning to ski. It was a lot of fun. Also, our instructor was great. He was patient, very present, and a great teacher. It was an enjoyable day.

table inside bubble in Whistler hotel

The cost of staying in Whistler varies, and while it is expensive in general, some places are affordable if you don’t want to spend too much. There’s also the option to make a day trip to Whistler from Vancouver without staying overnight. You can either drive to take a bus from Vancouver. There are many buses between Vancouver to Whistler every day. You can get the bus schedule from here.

We had a great time, got to visit a new place, learned to ski (beginner level), took many photos, and, more importantly, generated new memories. Whenever we travel somewhere, I remember the phrase “collect moments, not things,” and I cannot agree more.

Where are the Authentication views in AspNet Core App?

I am struggling with Visual Studio for Mac. I have been a Visual Studio user since it came in multiple CDs in a box. Visual Studio has been improved a lot, I like it more now than I did before. But there is a problem, the VS version for the Mac is a completely different product. I am both a Mac and PC user, I like both operating systems, Windows and Mac OS. However, I have been trying to use my personal laptop (MacBook Pro M1) for my personal software projects, and a lot of them were initially created with VS for Windows.

Visual Studio for Mac lacks some important things I use in my projects, for example, SQL Server Data Tools (SSDT) projects. I know that this is because we cannot install SQL in a Mac, and also know that there are alternatives to SSDT, like Azure Data Studio… but guess what? It’s not compatible with the ARM architecture which is what Apple’s new chip (M1) uses, and that’s the laptop I have 😕.

New Web project using Visual Studio for Mac

Anyways, that’s a topic for another post, this is about finding the Authentication views in an ASP.NET Core app. Since I couldn’t use this MacBook to continue working on my existing projects, I decided to use it only for new ones. That should be fine. So I have an idea for a book-sharing app, and I wanted to use VS for Mac to create this web app. I started with one of the templates and in less than a minute I had a working web app on my laptop. Next, I decided to scaffold the Authentication stuff to get authentication features and allow users to do stuff like the following:

  • Register
  • Login/Logout
  • Forgot Password
  • Reset Password
  • Confirm Email
  • Etc.

Scaffolding Identity features

I ran the following commands in my Terminal and on my project’s root directory to add the ability to scaffold the identity stuff. You might not need to do this if you have already installed the aspnet codegenerator:

dotnet tool install -g dotnet-aspnet-codegenerator

dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore
dotnet add package Microsoft.AspNetCore.Identity.UI
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package Microsoft.EntityFrameworkCore.Tools

dotnet aspnet-codegenerator identity -h

Where are my Identity views?

After this, I ran the following command to add the Authentication features to my project. The following command needs to be run inside your project’s directory:

dotnet aspnet-codegenerator identity -dc ReadMoreBooks.Data.ApplicationDbContext --files "Account.Register;Account.Login;Account.Logout"

After doing this, I didn’t see many changes in my solution, but when I ran my application again, I noticed I had the option to register, login, and logout. I registered a test user, and everything worked fine. Until I wanted to edit the page where a user confirms registration and also the page to reset the password. I was expecting to see ConfirmEmail and ResetPassword views under Areas > Identity > Pages > Account – but they weren’t there, only Register, Login, and Logout.

Where are they? After doing some research and spending a good amount of time searching for them in my solution, I found out that Microsoft hid these views to make projects smaller and more organized. This is the blog post where they announced that and that I clearly missed: https://devblogs.microsoft.com/dotnet/aspnetcore-2-1-identity-ui/

So, it turns out that by using the command line to scaffold these views I was already halfway from where I needed to be. What I mean by that is, by using the command tool (I think this is available through the UI but only in VS for Windows), all I had to do was either not specify which views I wanted to scaffold or specify all the views I wanted to include in my project so I could customize them.

The first command is what I ran initially, which helped create the Register, Login, and Logout views, and while everything else within the Authentication was available, the actual files were hidden.

dotnet aspnet-codegenerator identity -dc ReadMoreBooks.Data.ApplicationDbContext --files "Account.Register;Account.Login;Account.Logout"

Bringing back the Identity views into my project

So what I ran after was the following command, which added the views I wanted to my project so I could access them and customize them as much as I needed.

dotnet aspnet-codegenerator identity -dc ReadMoreBooks.Data.ApplicationDbContext --files "Account.ConfirmEmail;Account.ForgotPassword;Account.ForgotPasswordConfirmation;Account.Lockout;Account.LoginWith2fa;Account.ResetPassword;Account.ResetPasswordConfirmation"

That’s it! As soon as the command above was executed, all the authentication-related views appeared in my solution, just like in the old times. Perfect.

Now, I learned that I also have the option to run the same command without specifying the –files command, which will then add all of the available views related to Authentication to your project.

dotnet aspnet-codegenerator identity -dc ReadMoreBooks.Data.ApplicationDbContext

Conclusion and suggestions

So there you have it folks, a feature by Microsoft was a bug for me, at least for a while, until I understood what was happening, and then I learned how to navigate through the changes and get what I wanted.

If you want to learn more about the scaffolding options and how you can use them in your projects, check out this page from Microsoft: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-6.0&tabs=netcore-cli&viewFallbackFrom=aspnetcore-2.1

The moral of the story, read the documentation, keep up to date so you are aware of what’s changing and why, and maybe you’ll save some headaches and be more proficient with your coding. Hope this is useful. Cheers!