Web Deployment Project on VS2019 - asp.net

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)

Related

ASP.Net - Missing "aspx.designer.cs" files

We have two ASP.Net projects that we maintain with Visual Studio 2019.
The first project was originally built 10+ years ago and has been upgraded from one Visual Studio version to the next over the years. Everything runs fine.
The second project is a brand new project created with Visual Studio 2019. There are several web forms that we would like to import from the first project to the second project.
The Problem: Those web forms from the first project don't have a "aspx.designer.cs" files - each form only consists of an "aspx" and an "aspx.cs" file. And when they're in that first project everything's fine. They compile and they run fine. If we right-click and go the definition of any of the declarative objects in the "aspx.cs" file a window pops up saying it can't navigate to the symbol - which is fine. Everything works.
BUT... When those web forms are imported to the second project, all of the declarative objects show as being undefined - there's no "aspx.designer.cs" file where they'd normally be defined.
Any thoughts? How can we import and actually use these web forms in the newer project? Do we have to go and manually create that "aspx.designer.cs" file for each web form? There's quite a few of them...
Thanks!
Curt
All these effects are expected. An older/legacy site is represented by the "ASP.NET WebSite" template/structure, while the newer one - the "ASP.NET Web Application".
Check out the following threads to find differences and possible hints for migration (in short - move files as is, correct some #Page directives and code namespaces, switch to the ASPX Design View to re-generate the associated Designer file):
ASP.NET Web Site or ASP.NET Web Application?
Web Application Projects versus Web Site Projects in Visual Studio

Publish asp.net 3.5 website to local folder using MSBuild

I have a solution with multiple class libraries and a website (not a web application) in framework 3.5 VS 2008.
I would like to create a script/batch file to automate the publishing of the website to a given folder location(not to IIS).
I tried googling regarding this but everywhere they are refering to a .csproj file for the website. In my solution I do not have any such file for the website.
I do not want to use any add ons / other tools for automated builds right now.
Please suggest an approach using MSBuild or any other inbuilt asp.net tool.

How to update internal enterprise web page without Visual Studio project?

Problem 1 : I am not a web developer, but since people think all developers can do everything, I've been asked to look at a company's internal web site for the purpose of updating it.
Problem 2 : The company does not have the original Visual Studio project for the web site.
Question 1 : Can the files running the web site be used to manually build a working VS project?
Question 2 : Is it better or necessary to rebuild the web site from scratch?
Two are two ways to deploy ASP.NET:
Compile project and deploy aspx pages and dlls (I'm talking about webforms here, not MVC).
Source code (dynamic compilation available starting Framework 2)
In second case you can download all code, create project and add all files there.
If you have only complied version, it's more complex. You can get aspx files, but for code behind you can use for example Reflector or DotPeek.
PS. If you have ASP files, it's classic ASP, you have all source inside ASP (VBScript), so you can get everything and edit in VS or even in notepad.

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