AndyDev0918
AndyDev0918

Reputation: 103

Cannot rebuild ASP.NET Web Applicaiton missing solution file

I am taking over an ASP.NET Web Application using C# and all the code (including C# source) was given to me without the solution file (something.sln) so whenever opening the Web Application in Visual Studio 2017 I have to open by "Folder..." instead of by "Project/Solution...". Once open, I am able to make the necessary changes to the code behind files such as Default.aspx.cs or somethingElse.aspx.cs, but when I try to test the code changes by going to Run > Start Without Debugging, I couldn't find the Run menu option; I see the Build Solution button but it's disabled (greyed out).

Every time I try navigating directly to my site at http://dev.mydomain.com. The code changes I made did not get compiled neither.

So how do I get the Run or Build menu option enabled?

Upvotes: 1

Views: 1493

Answers (2)

thinker
thinker

Reputation: 176

Not sure if this is related, but adding the sln file to the git ignore removed its visibility from VisualStudio. I had to open the project csproj file in VisualStudio.

THen on close, the prompt was asking me to save a new SLN file with the same solution name i was looking for. I was then able to go to the directory with the original solution in it, and then I was able to open it again in Visual Studio. For all those who come to this post in the future, I would check your gitignore files and see if they ignored the sln file.

Upvotes: 0

ADyson
ADyson

Reputation: 61983

The easiest way to correct this issue is probably to create a new, empty ASP.NET WebForms project (and a new solution file as well if necessary) and copy your code files into it. You can then tell Visual Studio to "include" those files in the project.

You may (or may not) need to make the odd other minor adjustment too but those basic steps should get you started.

Upvotes: 2

Related Questions