C# MVC 4.5 dev experience

1. Say you have different environments for running project of different configurations, how to make it easy to debug and deploy in Visual Studio?

For set different configurations, use Web.config Transformation.

For direct publishing to remote server, use Web Deploy, need admin access.

We just like automation!

2. ASP.NET Identity

Authorization and authentication is a headache for web project. When creating a web MVC empty project, choose individual account for access control, and you can solve this kind of problem easily.

3. Image not found in CSS for project release mode

When deploying the VS project in release mode, it will automatically use the combined minified CSS/JS, which using a virtual directory for resource allocating. Image path in CSS may not found due to this problem, change the image URL to ‘/Content/whatevertotheimagepath’ directory.

4. How RememberMe works?

Remember Me?
If uncheck rememberme, MVC will create a default session cookie, which is usable cross tabs/pages for current login, but will be lost if user close the browser.

If check rememberme, MVC will create a persistent cookie for a default time expiration (configurable) for current login, usable cross tabs/pages, even close and re-open browser within the expiration period.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s