I have an ASP.NET, MVC4, C # application that I developed in Visual Studio 2012. So far, I have successfully deployed to the Azure website using the VS publishing tool.
Now, I have successfully set up Git publishing on the Azure website and linked it to the GitHub repository. I initialized the repository on my local computer and moved the entire batch to the GitHub repository. Lazur immediately pulled it all out, as it should.
Now, I expected that in the absence of a .gitignore file, this would not work perfectly, and I was right.
So my question is: Which of my local Visual Studio working directory should I omit from the repository? That is, what should be in my .gitignore?
Also, are there other factors that I should think about when trying to get the application to run on the Azure Website?
Notes:
1. I looked good at https://gist.github.com/2589150 , but it does not seem to match what I see in the VS working directory. <br> 2. https://github.com/github/gitignore/blob/master/CSharp.gitignore seems closer, and I'm currently working on this, trying to figure out which parts of it apply to my situation. For example, if I exclude bin / *, then the application will not be deployed to Azure.
UPDATE:
1) I disabled user errors by modifying the web.config file suggested by @levelnis:
<configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration>
I found that my problem was with the database connection string, which was no longer converted to Azure using the VS publishing tool. I had to change this directly and commit the repo.
Top tip:. I found the right line by simply seeing that VS Publish was exposed on Azure by publishing a temporary Azure site with a different publishing profile.
This fixed the problem and the deployment went very smoothly.
2) At this point, my .gitignore file had the following:
# Build Folders
obj /
# User-specific files
* .user
# SQL Server files
App_Data / *. Mdf
App_Data / *. Ldf
It seems like I may have cut out a lot more for convenience, but that did not affect the proper deployment work through GitHub, which now works very smoothly.
Finally, a handy Git command to delete files from a repo without deleting them. A few examples:
git rm -r --cached obj / *
git rm -r --cached * / *. user
And then obviously add them to .gitignore before adding, committing and clicking.