Why can't I find the Controllers folder in Visual studio 2010 - asp.net

I'm creating an ASP.net website, I am trying to find the controllers folder but I can't see it listed:
Here is a picture of what's listed:
http://s27.postimg.org/kjy7tjr9v/Asp_net_Images_Folder.jpg

A asp.net web forms project will not have a controllers folder. Make sure you set it up as an MVC project.

You need to convert your Web Site to a Web Application and then add the MVC components from the nuget package here:
http://www.nuget.org/packages/AspNetMvc

Related

Web Deployment Project on VS2019

I've created a blank solution in VS2019. Using the option "add existing web site" I've added a website to the solution which was built in VS2010. Normally, after that, I was used to add a Web Deployment Project to the solution, to compile all the code in one dll, and upload the result to the web server.
But this kind of project does not seem to be compatible anymore with the newer versions of VS.
Is there any way to get a similar compiled result in VS2019?
I found an alternative.
It is to convert the [asp.net web site] to an [asp.net application]. The asp.net application has a publish feature, which can be used to generate an output folder with the compiled application inside, with the aspx pages and a single dll.
I suggest to follow the steps described here to convert the asp.net web site to asp.net application:
https://learn.microsoft.com/en-us/previous-versions/aa983476(v=vs.140)

What template to use for new website in Visual Studio 2015?

I'm confused by the myriad of options for creating a new website in Visual Studio 2015.
In particular, I don't understand the difference between
File > New... Website... ASP.NET Website (Razor v3) and
File > New... Project... ASP.NET Web Application > ASP.NET 4.6.1 Templates > MVC 4
What I'd like is a website that works well with Entity Framework and provides scaffolding to quickly create data entry forms.
It seems MVC 4 provides this, but is there something similar for Razor?
The main difference between the Web Application and the Website is that it will compile the application into a single DLL file at build time. In order to update the project it must be recompiled and the DLL file published for changes to occur.
Read more at ASP.NET Web Site or ASP.NET Web Application? and Web Application Projects versus Web Site Projects in Visual Studio

Converting Silverlight application to Silverlight class library

In my Visual Studio 2010 solution I have a Silverlight application project and a hosting ASP.NET project.
Now I have added a new Silverlight application project hosted in the same ASP.NET project. I want to convert the old Silverlight application project to a Silverlight class library project, and be able to use it from the new application project by on-demand assembly downloading.
For this I need the class library project be built every time the ASP.NET project is built and the resulting DLL be copied to the respective ClientBin folder.
So my questions are:
1) How to convert an existing Silverlight application to a Silverlight class library?
2) How to host a Silverlight class library project in a ASP.NET project, i.e. how to make the DLL file be copied to the ClientBin folder of the hosting project?
Thanks in advance.
First unload the silverligh application. Then edit the .csproj file.
Look for
<SilverlightApplication>true</SilverlightApplication>
and set it to:
<SilverlightApplication>false</SilverlightApplication>
Save, reload and that's all.

Web.config transformation with SlowCheetah and ASP.NET Web site project

I'm trying to use SlowCheetah XML Transforms with an ASP.NET Web site project (not an ASP.NET Web Application Project) in Visual Studio 2010.
When I right click on the Web.config file in my ASP.NET Web site project, I don't see "Add Transform" item in the contextual menu.
(Note: it works well when a try with an ASP.NET Web Application Project).
Is it possible to use SlowCheetah with an ASP.NET Web site project ?
Or it's impossible "by design" because this kind of project has limitations ?
May be there is a workaround merging the "*.targets" files of the "Web Deployment Project 2010" and SlowCheetah...
SlowCheetah doesn't support website projects. What behavior were you envisioning here for website projects? For WAP projects they are kicked in during package/publish. For the Web deployment project suggestion I have created an issue to track that at https://github.com/sayedihashimi/slow-cheetah/issues/4, but I'm not sure how that would actually work. I'll have to think about that for a bit.
Update
Website project now has the same publishing support as Web application project, http://blogs.msdn.com/b/webdev/archive/2012/11/20/new-web-publish-updates.aspx, if you would like SlowCheetah to support transforming XML files please vote for it at: https://slowcheetah.uservoice.com/forums/185106-general/suggestions/3398137-support-for-website-project

How to get the Silverlight XAP copied to the clientbin on build

I am just getting started with Silverlight and have recently added a Silverlight project to an established solution. In this particular scenario my solution included an existing ASP.NET web site (not application) which Visual Studio kindly offered to integrated my Silverlight application into, which I accepted.
So everything is fine and all, and the Silverlight XAP is being copied to the web site's ClientBin directory. Now I have decided to start a new ASP.NET MVC web application that will eventually replace the older (non-MVC) web site. But I cannot for the life of me figure out what Visual Studio modified to get the XAP to automatically appear in the web site's ClientBin on build, so that I can reproduce that on my MVC site.
So my question is essentially, what are the manually steps for getting Visual Studio to autocopy a Silverlight application's XAP to a newly added ASP.NET MVC web application?
You can do this through the properties of your web project. The Silverlight tools for visual studio add a new tab to the properties of web projects named "Silverlight Links".
Add a reference to your Silverlight project here, with the folder where you want it, and visual studio will make the copy for you.
The copying of the XAP to the ClientBin is a MSBuild task. If you're using a standard ASP.NET project template it can be found under the Silverlight Link section.
For everything else you might be able to figure out the name of the MSBuild task and add it to your ASP.NET MVC project. The easier solution would probably be to use a custom post-build event on the APS.NET project to copy the file.
There is no "magic" happening, oter than copying the XAP file from the BIN directory of your Silverlight project to the ClientBin of your web application. It doesn't even have to live inside the ClientBin directory - you can copy it to any directory, or the root of your site.
Update: The recently released Beta 1 of ASP.NET MVC includes support for Silverlight projects, so you can link it to your ASP.NET MVC application the same way you do for regular ASP.NET applications.
Go to the property pages of your Silverlight application, Choose Build Events Tab, Enter following line in Post-Build events command line:
copy $(TargetDir)*.xap $(SolutionDir)<youar web solution folder name such as app.web>\ClientBin
Now onwards, on each successful build, the xap file will be copied automatically.
This is a somewhat older post so it probably has changed... in my Visual Studio under the web project there is a tab called "Silverlight Applications". There is an add button there for existing projects that you import into the solution and you can add them and choose to place the xap in the ClientBin or anywhere else. Not sure if you have to have the SDK installed to have this tab. I have it installed so you may have to. I don't do MVC, so it may be different for MVC projects, I don't know.

Resources