I am developing a project with Visual Studio 2015 and trying to publish it to Azure. While publishing, it throws an error stating that .mdf file under
Maybe you have created a mdf file inside the App_Data folder. The file is deleted from file explorer, but the file record haven't been removed from the project file. To check it, you could open your project file using notepad.
After opened the project file. You could search 'App_Data' to check whether there are content records like following. If yes, you just need to remove these records and save the project file.
<Content Include="App_Data\Database1.mdf" /> <Content Include="App_Data\Database1_log.ldf"> <DependentUpon>Database1.mdf</DependentUpon> </Content>