Answered by:
I have no build solution or publish option under Build menu

Question
-
User259881276 posted
My build menu will not show build solution, rebuild solution, build web, rebuild web or publish web. I can view it in my browser.
What can I do? This folder is a website that was upgraded from an old one with an older version VS.
Friday, March 26, 2021 1:24 PM
Answers
-
User409696431 posted
I'm a bit confused. Using VS 2019 does not require you to change your database from an earlier version. It doesn't require you to change the net framework from an earlier version for your website. This assumes the PC you are now working on has the requisite framework and database support installed. ...So, what are you updating, and why? If you want to update the framework, or the database, that is your choice to make, and which framework or database version is also your choice to make.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, March 27, 2021 5:20 PM -
User409696431 posted
Run an experiment. Create a new folder, and copy all your site source files into it. No .sln file. By "all of your site files", I mean the source files and other content for your site - only you know which files are what under the two-directory structure you have now.
First, check the .aspx files. Does the Page declaration at the top refer to the code behind files as CodeFile or as CodeBehind?
If they say "CodeFile" you are dealing with a compile on demand website, where you publish all the source files to the server.
If they say "CodeBehind", you are dealing with an application, not a website, where the code files are precompiled.
Which case do you have? If you have a website, not an application, you can simply open that website in Visual Studio: File -> Open -> Website, and navigate to the folder with your website files.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, March 28, 2021 2:27 AM -
User409696431 posted
First, if my answer solved your original question please mark it as the answer.
As for your second question, I don't understand what you did, or why. You say your .aspx Page directives have "CodeFile", which means it is a compile-on-demand webforms site. You publish all the source files to the server using a simple FTP copy. Publishing to another folder on your PC would be simply copying all the files from one folder to another. And the only way you could see a working page is to do it through Visual Studio so it would be running on a server. This would simply be VS opening another copy of your website, so it should behave the same. [The exception would be if you have IIS installed on your PC, and set up the site folder as a website in that IIS. Then you could see it if you accessed it through the correct http://localhost.... URL. Unless you think you have something that would behave differently on IIS vs IIS Epress, there is no reason to do that.]
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, March 28, 2021 4:51 PM -
User409696431 posted
For a website, not an application, no, nothing is pre-compiled. What needs to be compiled to run is compiled on the server when it is first requested. Publish your .aspx files, publish your .aspx.cs files, and all you images, CSS, etc files just like you have in your folder on your PC. You don't need to use Filezilla (although you can) - VS publish options include FTP. Just skip anything that looks like an option to pre-compile.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, March 29, 2021 9:45 PM
All replies
-
User-1545767719 posted
Are you looking for complied assemblies of the Web Site Project? If so, they are in the "Temporary ASP.NET Files" folder.
Friday, March 26, 2021 9:46 PM -
User259881276 posted
I don't understand. You mean the folder under c:\windows\Microsoft.NET.... ?
Friday, March 26, 2021 10:20 PM -
User409696431 posted
I think SurferOnWww misunderstood your question. The location of temporary files has nothing to do with your publish menu.
Is this Web Forms or MVC? If Web Forms, is this a website (compile on demand) or a web application (pre-compiled)?
Do you have the source files? Does it have an .sln file, and did you open it by opening the .sln file?
What version of Visual Studio are you using now? Have you successfully shown the build menu for other projects in this version?
Saturday, March 27, 2021 1:00 AM -
User-1545767719 posted
RaeKC
I don't understand. You mean the folder under c:\windows\Microsoft.NET.... ?Please read the following document:
Understanding ASP.NET Dynamic Compilation
https://docs.microsoft.com/en-us/previous-versions/aspnet/ms366723(v=vs.100)Below is extraction:
By default, when you compile a Web application the compiled code is placed in the Temporary ASP.NET Files folder. This folder is a subdirectory of the location where you installed the .NET framework. Typically, the location is the following:
%SystemRoot%\Microsoft.NET\Framework\versionNumber\Temporary ASP.NET Files
Saturday, March 27, 2021 1:20 AM -
User259881276 posted
Hello Thank you!
It does not have a .sln file in the main portion of folder. It has a subfolder with same name as main folder example: c:\myweb\myweb and there is a sln file in that inner folder. I get a warning about a one way upgrade when I try to open it. This happened quite a while ago so memory is rusty but I was trying to make copies of my good copy of my website and I ended up with this one. It was the only one that allowed me to preview in web, attach database, etc.
But now tonight, I right clicked on the .SLN file to see the warning again and it is about a "one way upgrade". I clicked to cancel out but then the site stopped responding and when I re-opened it, it now will no longer attach to my database that is attached in SSMS. It must have done some upgrading or something changes somewhere else. But the .sln is in that other folder. I'm not sure what happens if I move to main folder.
Saturday, March 27, 2021 1:37 AM -
User-1545767719 posted
KathyW
I think SurferOnWww misunderstood your question. The location of temporary files has nothing to do with your publish menu.
Is this Web Forms or MVC? If Web Forms, is this a website (compile on demand) or a web application (pre-compiled)?
misunderstanding???
Please note that the web application project is not "pre-complied" (according to the terminology in Microsoft document) by default.
See the following:
Compilation
https://docs.microsoft.com/en-us/previous-versions/dd547590(v=vs.100)#compilationBelow is extraction:
"For Web application projects, you typically build the project in Visual Studio or by using the ASP.NET batch compiler on a computer that is not the production IIS server. All code-behind class files and standalone class files in the project are compiled into a single assembly, which is then put in the Web application project's Bin folder. (The .aspx and .ascx files are compiled dynamically in a manner similar to what is done for Web site projects.)"
The same applies to the .NET Framework MVC application. Change "code-behind class" and ".aspx and .ascx files" to read "controller class" and ".cshtml and .vbhtml files" respectively.
Saturday, March 27, 2021 1:45 AM -
User409696431 posted
"All code-behind class files and standalone class files in the project are compiled into a single assembly, which is then put in the Web application project's Bin folder. " - That's pre-compiled. You are splitting hairs to point out that some files are dynamically compiled. A website has no pre-compiled files and all the source files are published. My point is that they are treated differently.
As for misunderstanding, you did misunderstand the original post, which was asking about VS's build menu.
Saturday, March 27, 2021 3:12 AM -
User409696431 posted
if c:\myweb\myweb is where your site files are, the .sln file could be in that folder. Or it could be one level up. You can see one case or the other when you create a new project in VS and select, or don't, the "create directory for solution" box. If there is only one project in your solution, either will work. What matters is what it says inside it.
Now, what was the "one way upgrade" warning, specifically? This is now a separate question from your original one.
If you ever get back to needing the answer to the original question, you can try to reset the menu options by:
Go to Tools -> Import and Export Settings, and select Reset all Settings, then select Web Development Settings.
Saturday, March 27, 2021 3:50 AM -
User-1545767719 posted
KathyW
"All code-behind class files and standalone class files in the project are compiled into a single assembly, which is then put in the Web application project's Bin folder. " - That's pre-compiled. You are splitting hairs to point out that some files are dynamically compiled. A website has no pre-compiled files and all the source files are published. My point is that they are treated differently.
As for misunderstanding, you did misunderstand the original post, which was asking about VS's build menu.
As for the "precompile" issue please refer to the following documents:
ASP.NET Precompilation Overview
https://docs.microsoft.com/en-us/previous-versions/aspnet/bb398860(v=vs.100)Web サイトの内容をプリコンパイルしておく方法 ... en-us version not available, sorry
https://docs.microsoft.com/ja-jp/previous-versions/technical-document/cc671425(v=msdn.10)As for the misunderstanding issue, you are supposed to say "My understanding is different from your understanding."
Saturday, March 27, 2021 5:31 AM -
User259881276 posted
KathyW, Thank you so much. Re: the build issue, I will try that as soon as I can and then post what happens.
If I have a question about trying to re-create my visual studio web and database so they are in same version, which one should I re-create or do I have to do both? My thought was that VS web I created if upgraded in VS 2019, would make my original database incompatible and so I would need to create a new database to go with it. But I don't know if I have to recreate that database from scratch or if there is a way to upgrade the original database (as with VS). I want to do whatever is easiest cleanest solution so that I don't keep having all these problems. If I need to post this question separately, I will do that.
Saturday, March 27, 2021 2:16 PM -
User409696431 posted
I'm a bit confused. Using VS 2019 does not require you to change your database from an earlier version. It doesn't require you to change the net framework from an earlier version for your website. This assumes the PC you are now working on has the requisite framework and database support installed. ...So, what are you updating, and why? If you want to update the framework, or the database, that is your choice to make, and which framework or database version is also your choice to make.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, March 27, 2021 5:20 PM -
User259881276 posted
Thank you. I'm a lot confused. lol but I am novice.
I get this message when I try to run program about it being v. 869 vs 852 I will run it again later and get exact error and post. I can't right now but will get it and post it later today. I thought that I had to be able to attach my VS 2019 to my SQL server to run and build make changes, etc. ?
Saturday, March 27, 2021 5:39 PM -
User259881276 posted
Hi,
I just opened and my project has mysteriously reconnected to sqlserver databases again in the SQL server object explorer. Last night, they had gone.
So I just tried doing the reset all settings. I wasn't sure whether i should use the Web Development or Web development *code only* option so I clicked the first one. But that didn't work to show the 'rebuild web' or 'rebuild solution' or publish option.
Should I cut and paste the solution to the main folder and let it upgrade the website? I am not sure but it may have upgraded it before. The way I have to open this folder is : when I open visual studio it shows the last file I had opened, example: c:\myweb . It doesn't show a solution. If its not in that initial list anymore when I open VS, I click the box on the right to "open file folder" and they all load in visual studio in the folders list. But since there is no solution in that main folder I'm thinking maybe that is why its not showing re-build or publish functions. (Its Visual Studio 2019. I had originally built this in VS 2008.)
So I was thinking of copying and pasting that SLN to main folder or maybe better to cut and paste? I'm hoping if I do that I can still view my website in the browser like I can do now. (I don't see the IIS in menu like older versions used to have but I have the option under File-> view in brower which is great because I can see if changes are working. But when I make changes and run them in browser, if all goes well, then I have to copy my changed files over to another copy of project that will let build but won't let me view in browser. Its all kinda skitzo the way I have to work around all these issues in order to publish.
I will post the answers to those other questions in the other box where they were asked as Firefox won't let me paste to this box.
Thanks so much.
Saturday, March 27, 2021 6:43 PM -
User259881276 posted
This is not MVC. I don't think I've ever used MVC. Its web forms I guess. As for whether it is a website, compile on demand or web application (precompiled) I think its the first. In past I had always chosen to create web site and then build, re-build solution. Then when i wanted to publish to my host's site, I used to choose option to precompile and then published the precompiled web via FTP. I see they don't seem to have that choice to choose to build a precompiled copy for publishing or maybe its there and I don't know where it is. I'd rather not do it that way anymore however because when I download a backup copy from host, I don't want to only have a precompiled copy. I get a warning if I try to open a precompiled copy in VS. I want a regular copy so I can open and make changes if I need to use the host's backup for some reason.
When you ask do I have the "source files", these are the files I always had except there is no solution file. These are my website's files that make up the complete website. It just doesn't seem to be packaged in a ".SLN" because it was copied from another location. I think what happened was I was trying to make a new clean copy a couple of years back, and just copied all the files but not the solution and then didn't know how to create the new solution. I have never opened this copy with a solution file . The one that's in the sub folder may be the one I copied from the other folder.
I've always been able to see build, solution, publish in my menu in the other projects. Just not this one.
I hope I answered all the questions you needed.
Thanks
Saturday, March 27, 2021 6:59 PM -
User409696431 posted
Run an experiment. Create a new folder, and copy all your site source files into it. No .sln file. By "all of your site files", I mean the source files and other content for your site - only you know which files are what under the two-directory structure you have now.
First, check the .aspx files. Does the Page declaration at the top refer to the code behind files as CodeFile or as CodeBehind?
If they say "CodeFile" you are dealing with a compile on demand website, where you publish all the source files to the server.
If they say "CodeBehind", you are dealing with an application, not a website, where the code files are precompiled.
Which case do you have? If you have a website, not an application, you can simply open that website in Visual Studio: File -> Open -> Website, and navigate to the folder with your website files.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, March 28, 2021 2:27 AM -
User259881276 posted
It is the CodeFile. I did what you said, and then went to file ->open web and there was an option for opening as a web and it worked!
Then all the build functions were in the menu and I can do it all. Thank you so much. I am so grateful for your help! I can view in browser and build and publish.
One more question if I may : I put the published file in another folder with similar name (myweb folder to mywebPBL) so it will be easy for me to always find published versions since they will be next to each other in file folder. I then opened the published folder version. I was curious to see how they would display in browser before I uploaded to host in case anything was different. But when I try to view a form page in my firefox browser, I get an error "Unable to connect to the configured web server". Just wondering if that is normal or if I should be able to view in browser like the one it was created from?
Sunday, March 28, 2021 4:11 PM -
User409696431 posted
First, if my answer solved your original question please mark it as the answer.
As for your second question, I don't understand what you did, or why. You say your .aspx Page directives have "CodeFile", which means it is a compile-on-demand webforms site. You publish all the source files to the server using a simple FTP copy. Publishing to another folder on your PC would be simply copying all the files from one folder to another. And the only way you could see a working page is to do it through Visual Studio so it would be running on a server. This would simply be VS opening another copy of your website, so it should behave the same. [The exception would be if you have IIS installed on your PC, and set up the site folder as a website in that IIS. Then you could see it if you accessed it through the correct http://localhost.... URL. Unless you think you have something that would behave differently on IIS vs IIS Epress, there is no reason to do that.]
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, March 28, 2021 4:51 PM -
User259881276 posted
Ok. I use file zilla.
And these published files are not precompiled?
Monday, March 29, 2021 2:14 PM -
User409696431 posted
For a website, not an application, no, nothing is pre-compiled. What needs to be compiled to run is compiled on the server when it is first requested. Publish your .aspx files, publish your .aspx.cs files, and all you images, CSS, etc files just like you have in your folder on your PC. You don't need to use Filezilla (although you can) - VS publish options include FTP. Just skip anything that looks like an option to pre-compile.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, March 29, 2021 9:45 PM