Adding existing Web Site in IIS to Git in Visual Studio 2017 - c#

I am trying to add a repository containing the html pages, javascript scripts, images, and c# code files for my website hosted on IIS. I have a solution in visual studio 2017 that has the website added as a project, but as Web Site's go, the actual files for the website are in a different folder than the project (inetpub vs the defualt project file location). When I tried to add the project to git from visual studio it says the portions of the website outside of the project folder will not be added or maintained by git. Is there any way to get my code onto git?

If this is your first time using git, I recommend checking out a few of the courses available online, such as Github's Hello world or their Try It tool, or a tutorial offered by someone else, like this one.
There is also an official book on how to use git and how it works, available online for free, here.
Keep in mind that while these links are mostly around github, you can use the tools here with any git host, like GitLab, BitBucket, or even your own self hosted solution

Related

Can't run a very old ASP and flash project

I come from JS world and have to run an old ASP project to see its structure.
But I can't understand what kind of framework have been used to create this.
Have tried to build it with dotnet but it's not recognized.
Here is the projects screenshot can some body recognize it and tell me how to run it locally ?
I would try opening this would Visual Studio. That does look like a typcial asp.net web forms proejct.
If you ahve a ".sln" file in the root folder, then you should be able to open this project with Visual Stuido. (just download 2019, or latest 2022).
You will almost for certain want to open this project with VS.
If there is no .sln file in the root folder, then choose from VS to open as web site.
So, there are two ways to open/use/develop these older asp.net applications. the existence of a .sln file tends to tip you off as to which method you need (and want) to open up this applcation with. But, yes, you need VS .net "IDE" and the built in designers to work on this.
So, from your screen shot, go up one folder - look for a .sln file. That's the project file you want to try and open with Visual Studio.
As noted, if no .sln, or no .prj file exists, then use the open as web site option in VS.
Looks like a WebForms project, not sure about the state of WebForms support for VSCode but Visual Studio Community should be able to run this. Try loading this project with Visual Studio ensuring you have ASP Web development work load installed.

How to create a "content only" project in a Visual Studio 2017 solution?

Is there an easier way to create content only projects in Visual Studio 2017 with out having to edit csproj files?
My objective is to have a class library project in my solution that does not produce and assembly/dll.
ASP.NET Empty Web Site is the project type you are looking for. It is located under Visual C#-Web-Previous Versions.
Project file structure
There is no project file (.csproj or .vbproj). All the files in a folder structure are automatically included in the site.
Compilation
If you do include source code in the project, the source code is typically compiled dynamically (automatically) by ASP.NET on the server the first time a request is received after the site has been installed or updated.
Deployment
You copy the application source files to a computer that has IIS installed on it, or use visual studio tools that integrate with Web Deploy (the IIS web deployment tool) to automate many deployment tasks.
Limitations
There are a number of limitations to these project types but if you are only looking for static content and no compiled assemblies, the limitations should not affect you.
There is much more documentation located here regarding the specifics of this project type.

WebMatrix static code analysis for Umbraco dot net app

I am conducting an audit for an app being programmed by another developer. It is a dot net app, mostly c#, but obviously contains html, css, js, and some angular. This product was written using the CMS Umbraco, which means I can't open it in Visual Studio and must use WebMatrix. I have to run a static code analysis, code violation checker, and quality metrics report on the product. What tools should I use to run this reports and how to I run them inside WebMatrix? Visual Studio already has code analysis built in, but I can't find anything built into WebMatrix for this.
Visual Studio solutions typically consist of a .sln file which may reference multiple project files (.csproj, .xproj...) but Visual Studio also supports opening Web projects from directories File > Open > Web Site... When exiting or Saving all VS will prompt you to create a new solution file for the Website making to quicker to open from VS next time.

Git not publishing all files in a c# Project of VS2012

I'm new at using Git, and I have a problem while publishing a VS Project into GitHub.
Well, what I did was, first creating a GitHub account, then I installed Update 3 to VS 2012, and then installed Visual Studio Tools for Git so I can integrate Git with VS.
Then after that, I created a project in VS, it was a solution with 3 class libraries projects and one wpf project, everything in C#. After that I right clicked on my solution and chose commit, and then published it into a repository I created on my GitHub account.
It was supposedly published at GitHub, but when I decided to clone it locally to another computer, and after entering the project, it showed up a message saying that 2 projects of the solution couldn't been loaded.
Then I made another test, but instead of making it in C# I choose VB, I did the same steps, but this time it was published correctly into GitHub.
Why is it giving me problems only with C#?

Open an Umbraco web site using Visual Studio

I have a website hosted using Umbraco and I want to explore the website in Visual Studio to make changes to it. I would like to open the Code that is already hosted. Is there anyways to get to it ?. Thanks in advance
You can download the source code from the live hosting (assuming you have FTP access) and open it in Visual Studio to look at the files and make changes. Just open the folder with the files in that you downloaded as an existing website in Visual Studio and you'll be sorted.
However, it will depend on what you want to change. If you want to edit the actual page content, you'll need to do that via the CMS interface (as that's all stored in the database). If you want to edit the Templates, CSS, Javascript, XSLT Macros, Razor Scripts (if its running the latest version of Umbraco and is using Razor) etc, then you can edit all of those by logging into the CMS as an Administrator. Templates, CSS and Javascript can be edited from the "Settings" section of the CMS. Macros and more advanced stuff like data types can be edited from the "Developers" section of the CMS.
The likelihood is that your Umbraco application will have been deployed in it compiled state.
In this case, you can download it and then open it in VS using the "File > Open Existing Website" option.
This will give you the ability to alter files like the CSS, javascript, masterpages, xslt and usercontrols but it will not provide you with access the "inner workings" of the CMS since this will all be compiled.
It is very rare that you should need to change any of the core CMS code but if you wanted to look around as a learning exercise (highly recommended), then you can download the source code from here.
Also be aware that the version running your site will not necessarily be the version available for download. The last version of the webforms-based Umbraco is 4.7.1.1 however they have just release Version 5 which is based upon MVC3.
Edit:
Version 5 was shelved and is no longer available. 4.11.x was the last version to be made available before the core API was rewritten in PetaPoco in v6.
Visual Studio is just an IDE. You can open any file in it (within reason). I often drag files I want to work on into the visual studio window in order to open them.
Generating a project from the files is a different trick altogether and takes a lot more effort.
Try this question for how to do that.
Download the project template for Umbraco for visual studio 2010
goto tools -> Extension Manager then search for umbraco mvc in online gallery.
after the installation of template, you will be able to create umbraco MVC projects.

Categories