How to open a .publishproj file in Visual Studio 2017? - asp.net

I just simple know that is a published project, but how to open that file as a project? Here is the story, I got a file from a contractor with all the project and the pages and I would like to check the code and run the project from Visual Studio 2017.
Sorry about my ignorance and thanks in advance.

You can't.
What you can do though is create an ASP.Net Project (e.g. .csproj) and then right-click on a folder or the root of that Project and select "Add Existing Web Site...". This adds your site to that solution.
Note that .publishproj projects ("Web Site" Projects, aka "Web Applications") are not really compiled/built. (Though they can be pre-compiled, but that's not the same thing).
Web Sites are "published" not "built". Note that publish profiles (.pubxml) files are stored in /App_Data/PublishProfiles folder and work very much the same as .csProj files. In fact MSBuild will recognize some of the same elements, such as <task> and <using>. You just have to manually add them.

Related

Visual Studio Copy the Project to an external drive

I had done a project by using ASP.NET MVC. How do I copy and paste the project to an external drive. I have to submit my project as coursework yet they request to copy the entire project to a CD/VCD.
The problem is when I copy & paste the project into a CD, it can't run properly with loads of errors. How do I do this in the cleanest way possible?
Snippet:
Here's the warning message.
You can delete .vs folder. Visual Studio will recreate it, when you open the project.
The main issue is Visual Studio cannot read and write to CD. However, you can copy the project into USB Flash Drive, and open the project straight from it.
Starting from Visual Studio 2012, Microsoft uses IIS Express by default to host ASP.NET applications, which relies on a file applicationHost.config to store the site information.
The design of applicationHost.config, means a physical path to your project directory is hard coded which prevents this project from running if you simply copy the project to another location on another machine without updating applicationHost.config. What's worse, starting from VS2015 this applicationHost.config lives in .vs folder inside your project directory, which can be copied to other machines by mistake.
Read my blog post to understand the technical details if you like,
https://blog.lextudio.com/jexus-manager-secrets-behind-visual-studio-iis-express-integration-834f88c8e8b

What files do you check-in to source countrol management system when working in an ASP.NET web application?

We have a main web application that references several other projects. Do you check-in .csproj/.sln files into source control? If so, do you use these files for msbuild or do you just include *.cs to build your dll? Does ILMerge help in any way with performance?
You should aim to check in everything that is needed so that someone can take a fresh install of Visual Studio, do a checkout, double-click the .sln file, build and be on their way.
.sln and .csproj are a no-brainer, in my opinion: what happens if you add a new file to the project: everybody would have to manually add the file to their project files if you didn't commit the .csproj file.
ILMerge - no. Not for web applications. Not for the rest either.
Checkin? What about letting visual studio handle it. Now, in general - source control without all relevant files is garbage ;) So, it should include stuff like the project and solution.

Using references in ASP.NET with Visual Studio and TFS

I am working with Team Foundation Server and Visual Studio 2008 for the first time. I had a web site project that was done with Visual Web Developer Express, which I have converted to a solution containing a Web Application Project, setup for TFS source control, etc etc.
TFS was having issues checking in/uploading some of my referenced DDLs, specifically AjaxControlToolKit, saying things like /bin/AjaxControlToolKit.pdb couldn't be found. I removed the reference, deleted everything it had in /bin (it had created lots of folders like /ar, /cs, /de, etc etc along with other files like /bin/AjaxControlTookKit.dll), then re-added the reference to AjaxControlToolKit. It will now upload, and works fine locally, but it didn't re-create anything in /bin. I have other references that work fine and have info in /bin (ie: /References/LinqKit.dll and /bin/LinqKit.dll) I cannot do a build on the server yet, but locally it works. So, will this work when its built on the server? Why didn't it recreate anything in the /bin folder? Is that something to do with Visual Web Developer Web Site vs Visual Studio Web Application/Solution? Any info is appreciated! Thanks.
References are references, not copies of the assemblies. Where are the assemblies you're trying to work with?
Typically, you'll want to check in third-party assemblies that you are not maintaining source. You'll then want to change the file references to point to the version from source control.
Of course, this means that all your developers and build machines will need to maintain the same folder structure on disk.

Finding the .Net framework

Is there a way to find out which .Net version i.e. 1.1 or 2.0 or 3.0 etc.. was used to create a web project. I have files like .aspx, .aspx.vb, web.config etc but need to figure that out.
Also how to open the existing ASP.Net project in Visual Studio environment. I have received files from another person but for security reasons he do not want to share the complete project but only selected files. We both would like to know what is the bare minimum files which needs to be shared to open an existing project (I mean apart from the .aspx, .aspx.vb files which needs to be modified)
Thanks
If its ASP.NET project check the <assemblies> element in web.config its must contain versions of each assembly you use.
Please try this:
Open Visual Studio.
Click on File -> Open -> WebSite (Or press Alt+Shift+O).
Select the folder which containing your file (aspx, aspx.vb, web.config)
In most of the cases it will open the folder as web site and you can run it with F5.
I don't think the files you mentioned will contain any references to the version of .NET they were build under, not unless they feature version-specific code & functionality (LINQ for 3.0+. generics for 2.0+ etc).
In order to open an actual Web project in Visual Studio, you need the project file. Without that you will only be able to open individual files.

What are the pitfalls of combining a web site project with a web application project in Visual Studio?

I have a web site project with a lot of files, it has become really slow to build. What I want to do is to create a web application project, and in Explorer add all the files to it, including the Bin folder. In Visual Studio I will not add these files (Show All Files will show them), only new files in one new folder that I am going to work on.
There are several assemblies in the original Bin folder that I need to reference in the web application project. Also, I will include the original web.config file.
So what way am I going to regret this in a few days?
You wont have support for all the old stuff when using the Visual Studio Publish feature (I assume you wouldn't anyways).
I also would assume you wont have access to what is in your App_Code from your new web application project.
I will add an answer myself.
A rebuild in Visual Studio will clean out the bin folder...

Resources