Publish Web App to Azure

Log onto the Azure Portal, go to the App Services and select the App that you need to publish from Visual Studio to Azure.

Click on Get publish Profile. This downloads a Settings file.

In Visual Studio go to Publish and selete the "Import Profile" option.

Then import the Profile that you just exported from Azure. Done!

Restore local SQL database to Azure SQL

On local SQL Server database right-click on the database, Tasks, then Export Data-Tier Application to create a *.bacpac file.

Connect to the Azure database server via SSMS. Right-Click on the Azure Databases node. The Database cannot currently exist, so if it does it needs to be deleted first!

Select Import Data-tier Application and select the *.bacpac files that was created in the first step. This creates the database in Azure!

Don't forget to select the Edition of Microsoft Azure SQL Database before you complete the process.

Visual Studio compiles fine, but it still shows red lines

More Info Here: https://stackoverflow.com/questions/21098333/visual-studio-compiles-fine-but-it-still-shows-red-lines Visual Studio 2019 is showing red underline all the time, even when it compiles fine!

Closing Visual Studio and removing the .vs folder located in the solution directory worked for me.

This folder has a hidden attribute. You may need to change settings in folder options to show hidden files.

MVC display moves if there is a scrollbar.

Use this in the _layouts view to prevent the annoying left twitch if the content is longed than can fit on the display. The scrollbar moved the display to the left unless you put this in the _layouts View.

       /* prevent layout shifting and hide horizontal scroll */
        html {
            width: 100vw;
        }

        body {
            overflow-x: hidden;
        }

MVC Blank Space Above Navbar

I recently came across a very annoying "feature" when developing an MVC5 site, and it took a few hours to resolve.

The white/blank above the navbar is the issue. To resolve this I added a margin-top: -50px in the Header of the _layouts view and all other _layouts that I had developed. Now it looks like this.

<style>
        body {
            margin-top: -50px;
        }
</style>