简体   繁体   中英

VS2008, Add New Item, “Web Content Form” option is missing

Today I realized that I no longer have a ”Web Content Form” option (where you select a MasterPage) when I add new items to my ASP.NET web application. I know how to manually add a MasterPage to a web form, it's just such a pain – and I really don't understand why Web Content Forms suddenly are missing.

Visual Studio Team System 2008, SP1, VB.NET, ASP.NET 3.5

I recently installed and uninstalled VisualSVN. My best guess is that screwed up my poor VS somehow.

How do I get Web Content Forms back??

Close all your instances of visual studio Open a VS command prompt and type

devenv /installvstemplates

this should re install all your VS templates

I was missing most of the templates from the Add New Item option.

Using Jon's answer I was able to fix this by changing Tools -> Options -> Projects and Solutions -> General -> User item templates location to this path:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Web\1033
(without (x86) if you have a x86 OS)

instead of

C:\Users\%USER%\Documents\Visual Studio 2008\Templates\ItemTemplates

I suppose you can also copy the files into that location instead of changing the path.

按照链接https://superuser.com/questions/1441880/visual-studio-2019-web-site-template并从 VS 安装程序修改中选择“附加项目模板(以前的版本)”-> ASP.NET 和 Web 开发

Try resetting all of your settings.

Tools -> Import / Export Settings

This will bring up the settings import wizard. Choose reset all settings and select the Profile your are comfortable with (your post said vb.net so probably the VB profile). See if that fixes the issue.

Did some digging and I think the Templates live here:

C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\ItemTemplates\\

and the template for the content page is this:

C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\ItemTemplates\\CSharp\\Web\\1033\\ContentPage.zip

I am unsure about how you would get a new copy of that file if it is missing for you without reinstalling VS

For me, there was a checkbox at the bottom of the dialog named "Select Master Page". So I checked that option, selected "Web Form" and I was given the "Select Master Page" dialog. :) This was VB.NET. I usually code in C#. Also this was a Web Site. I usually create web projects.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM