Generate a Sandcastle help file for a website without the "Xml Documentation File" option - asp.net

I am trying to generate a Sandcastle help file for a website. In the properties window for project, there aren't any options for creating the XML Documentation File required for Sandcastle.
The Build tab in the property pages only contains options for: Start Action, Build Solution Action, and Accessibility validation. I don't have any options for Output, or XML documentation file, like my other projects have.
The website I'm working with does not have an actual .proj file, which could be the problem. If this is the problem, what is the best way of creating one for a project that is under source control and being worked on by many people with minimal disruption?
This is using Visual Studio 2005 professional.

The problem with websites in VS2k5 is that, when they get compiled, the resulting dlls are a mess. No namespaces, weird names, etc.
If you truly want to generate a Sandcastle Help File, look at converting your website into a web application. You can definitely generate source code docs for that.

I haven't tried it yet, but you might want to try the following
Documenting Web Sites / Projects from Eric Woodruff's site. It gives the specifics on how it can be done.
Update: I did try it and it works for regular websites. The only issue I can see is
that the websites don't have namespaces. So when I run it I get a topic by
FolderName_WebPage Class format without any logical grouping. So it is alhpabetical by
folder and page name. Once you got the content created, you can edit the help file using
a helpcompiler / builder and group the topics as needed.

Related

Custom path for folder

How to add a reference to the App_code directory for a sub-folder in web project
I have been given a task to take an older, grown piecemeal over a decade internal website and bring it "up to speed". I have run into a problem in ASP files to "see" the app_code directory. Essentially the current site is a collection of folders that work(ish) that I am trying to collect together as a single project with the LEAST number of edits.
When functionality was superseded the old code was moved into a "deprecated" folder. The code files now reference object in the app_code directory which is not visible to the file from it's new location. The easy answer would be to copy a version of the class file into the "deprecated" folder but that seems more like a hack then a solution. The same for copying the App_code folder to a location visible to the ASP file.
My thought was to add a reference ("reference path") somehow to the deprecated folder pointing to the app_code folder but I cannot find how to do that.
A couple of other notes: 1) the site was built by using text editors and "freebie" editors - it has never been compiled or run in-total through VS before. 2) once I get it built and checked into TFS I am going to remove the deprecated folders. 3) I am working under some stipulations to satisfy concerns arising from actions of prior developers.
Code like:
tr.Controls.Add(GUI.GetTableCell("Salesman", 0, "Center"));
Works well when the ASP page is at the same directory level as the App_code folder ("GUI" is a class with a "GetTableCell" function).
If I can add a folder reference I can solve all of the remaining problems I have with this step in the project.
EDIT
Let me re-ask it this way. The image below is a composite of what I am facing in VS2017. I have such a feeling that a light bulb is simply not turning on for some reason. How I have done this so far is pulling down the current website from our internal Win2003 web server and am trying to convert it into a legit web project. I have done many of the steps necessary but there are 47 instances of the problem visible in the composite image from Visual studio
The code behind from SubscriptionEditor.aspx pictured lower right. Has reference to a namespace which is in the code files in the App_code folder (neatly hidden). This site functions fine but I am missing something to make it work from within VS. I am just at a loss.
For anyone that finds this I want to point out that there are a number of excellent answers available for similar questions here and i have looked at dozens and tried them all. The simple answer to my problem is "you can't".
How to convert ASP.NET website to ASP.NET web application came close
The problem being the source is just a collection of ASP files - it follows no project or template.
Namespaces are super important in development and the clever ways that prior developers found to breach that discipline can not be fixed through VS. It is simple a lot of bloody knuckle corrections of code and scope issues til the errors disappear.
The limitations put on me prohibit any solution. I will end up advocating not "saving the code" unless they are willing to put in the investment to heal the most egregious foibles. So if you see me in the "available for contract" sites then you know how that conversation went.

Visual Studio Unit Test From Existing ASP Web Site

Denizens of Stack Overflow, I come before you in hopes of solutions to my current problem, as so many of my questions have been answered by you veritable founts of knowledge. Is there a simple way to create a unit test for an ASP Web Site Project that was already created without requiring the installation of software that requires you to buy them should you wish to continue using them? If there was a way to get the ASP Web Site directory to be treated as a Project, that would solve things very smoothly. There are two methods to accomplish this that might still be viable but that I have given up on are:
Linking the ASP Website Project to a normal Visual Studio Project.
A method I saw online suggested that one could simply drag the ASP.Net Web Site Folder on to a normal VS Project and this would effectively make the Project a copy of the ASP Web Site with all functionality of the Web Site for Unit Testing with the sublime easiness of being able to use Add Reference for the Unit Test Project, so much more simple than what I've encountered with Add Service/Web Reference. On a similar note, there was a website that suggested adding all the content of the ASP Web Site into the Root of a project. Neither of them worked for me, but I might have been made a mistake in my interpretation of the instructions.
Once I gave up trying to get the Unit Test to Add Reference to the ASP Web Site, my next approach was to link a Web Reference to the Unit Test. At first I tried placing the http://localhost(number)/ of the ASP Web Site in the Web Reference URL, but that didn't work. I saw something that mentioned creating an IIS Site for the Unit Test to reference, but I couldn't make much sense of it.
I've been trying to come up with a wsdl file, and to that end I downloaded WCF LOB Adapter 2013. I don't have BizTalk installed, and after the software provided the message that BizTalk needed for BAM to be installed, I decided against downloading further software. BizTalk itself was already about 660 Megabytes, and for something that is easily a fifth the size of the entire Windows 10 Operating System, I thought that BizTalk ought to be able to run without needing additional specialized software.
I recently discovered that .asmx pages happen to show up when I tried to Add a Web Reference. Instead of giving me an error about connectivity, I received an error stemming from how I had duplicate web.config files in the same solution thanks to trying so many different approaches without success and not clearing them out.
I haven't really looked much into MVCs because the tutorials I go through don't really show how you use MVCs to test the existing code of one of the various aspx pages that my company wants to have Unit Tested.
I think I was having success with [this][2] tutorial, but trying to run a asmx file I created gave me the "Not well formed" error, and my Command Prompt doesn't recognize me as administrator, even though Control Panel says I have admin privileges, which seems to be a large impediment to applying the different work-arounds. However, after using "Clean Solution" several times and deleting other projects from the solution, I was able to run the asmx file after all. However, now I'm stuck on the end of the 2nd step where a batch file (.bat) is supposed to be creating a .cs file in the Bin folder from the .asmx page.
I've gotten to where the Visual Studio Developer Command Prompt is okay with both 'wsdl' and 'wsdl.exe' no longer give the:
wsdl/wsdl.exe "is not recognized as an internal or external command, operable program, or batch file" error.
The contents of my batch file are:
wsdl /l:CS /n:WService /out:bin/wsdlWalkthrough.cs
http://localhost/webserv.asmx?wsdl
Since I'm trying to follow the steps of an article old enough to have graduated elementary school, the syntax may easily have changed. Instead, now I get the error:
'http:' is not recognized as an internal or external command, operable
program, or batch file.
I'm going to make this one into a question in and of itself, because this question was if there was a smooth, simple, cost-free way of setting up a Unit Test for an ASP.Net Web Site, not specifically to answer any of my problems, though such would be received with much gratitude.
[Another tutorial][3] might yet provide me a solution, but I'm not going to hold my breath.
UPDATE 2/29/2016
With assistance from Stack Overflow's ever so helpful ChristiFati, I was able to get through Dimitrios Markatos' Creating and Consuming .NET Web Services in 5 Easy Steps which can be found at http://www.sitepoint.com/net-web-services-5-steps-3/ The article may be over a decade old, but it was still by far the easiest method I came across in my week or two of trying to figure out a way to add a reference, or in this case Add Web Reference that I came across. Two things to be careful of though. The first is that if you copy and paste code directly from the tutorial, you might end up with errors because the batch files you make will have an extra newline character, which caused the Developer Command Prompt for VS2012 I was using to run the .bat file to give me the
'http:' is not recognized as an internal or external command, operable
program, or batch file.
error. Thanks again to ChristiFati for pointing that out for me. Similarly, the instructions for Step 3 give you the following code for a second .bat file:
csc /t:library /out:binGetSuppliers.dll binGetSuppliers.cs
/reference:System.dll,System.Data.dll,System.Web.dll, System.Web.Services.dll,System.XML.dll /optimize
Besides eliminating the white-space and newline characters, the above code should probably look more along the lines of:
csc /t:library /out:bin/GetSuppliers.dll bin\GetSuppliers.cs
/reference:System.dll,System.Data.dll,System.Web.dll, System.Web.Services.dll,System.XML.dll /optimize
But aside from that, the tutorial was a gift from God after all the dead ends I had come across. I'm judging my question answered because the critical issue was being able to give my Unit Test a Reference, whether a normal reference or Web Reference. I do not anticipate any more major difficulties and hopefully I will be able to finally proceed to Unit Testing for one of our ASP Web Sites. If not, this post will be edited to describe the newest problem.
Well, this is ridiculous. I'm able to add the Web Reference just fine, but doing so seems to have done diddly-squat for being able to reference the different .cs pages anywhere inside the ASP.NET Web Site. Does anyone have a way to get a Unit Test to be able to reference code/classes within an ASP.NET Web Site?
UPDATE 3/8/2016
There is a somewhat simple solution to the problem in placing all the functionality of your website into a DLL. Once that is done, right-click on the Unit Test project and select Add Reference. The DLL didn't show up on any of the tabs, but I was able to select the appropriate DLL by clicking on Browse.
Still, if there's any other ways to set up Unit Tests from an existing ASP Web Site where such a DLL doesn't exist.
My Visual Studio 2013 Solution
[2]: http: //www.sitepoint.com/net-web-services-5-steps- 2/
[3]: https: //msdn.microsoft.com/en-us/library/ms731835%28v=vs.100%29. aspx

Where are the models referenced at the ASP.NET web site of SPA tutorial?

Here at the step 5 of the first exercise (In the Add Existing Item dialog box, navigate to the Source/Assets/Models folder and select all the files. Click Add.) the tutorial make a reference to a set of files that I don't know where they are. Where I can find those files?
At the top of the page:
All sample code and snippets are included in the Web Camps Training Kit, available at http://www.microsoft.com/en-us/download/details.aspx?id=36393.
Once installed read the readme, you are doing the Hands On Lab (HOL) for AspNetWebApiSpa:
C:\WebCampsTK\HOL\AspNetWebApiSpa\Source\Assets\Models
I had the same issue...
I found the files were installed in:
c:\WebCampsTK\HOL\AspNetWebApiSpa\Source\Ex1-CreatingAWebAPI\End\GeekQuiz\Models
The needed files may be installed elsewhere also (too many folders) but this is where I found them on my system after performing the install.
Hope this helps!

recover project in visual studio 2010

i have 4 project in my solution, framework , domain objects,business objects and website ...
but this morning website project couldnt be loaded... when i tried firsttime to open solution... "The solution file has been modified outside the enviroment" message seemed and press reload then error is project file is corrupted... how can it happen... how can i fix this...
thx..
One way... if its from some source control , get the latest and leave the changed part by you.
If you dont have any source control then you can have the two options
- Create a new solution and add all your projects to it and rebuild it. Check for the errors.
- If your code is completely corrupted and files are unreadable, that is unrecoverable,
then you must have to follow this
copy the projects dlls out of bin
dir,
use red gate reflector and extract
all the class file in new project
file.
Now for aspx.cs you can create a new
project add all aspx file in that new project and also the
new cs files generated by the reflector addin. Do it for all pages. When done , right click on Project of web app(if its), then choose convert to web application. Also check the Page header of each page that they are using the same class files.
I know this is little bit tough , but will work....to recover almost that much code, when your app was last compiled.
Note : Also you will have to maintain the hierarchy of the project as the reflector add in (FileGenerator on Codeplex) might miss the actual project hierarchy.
You can open your solution file (.sln) in notepad and check for the consistency of the document.
The sln file will be in a hierarchical structure (like we have an xml).
You can also open csproj files of different projects that you have in the solution check the xml of the csproj.

TortoiseSVN with ASP.net Web Projects - How to manage this?

We're a small team starting to use TortiseSVN to manage our web projects.
I was just wondering what is the best way to manage web projects into Subversion.
As you know a web solution consists of the .sln file as well as all the .aspx files.
Well we noticed when we right click the solution and we select "Add selected projects to subversion". It prompts me to tell it where to store the .sln file. So I give it some path like svn://serverName/CIS/MyWebSiteProject. Cool it just placed the .sln file...so I thought to myself how is it going to store the .aspx files as well.
Within a second I got a second prompt, I thought cool it is prompting me for the .aspx pages. So I tried giving it the path svn://serverName/CIS/MyWebSiteProject/ASPX_Files, but it comes back with an error stating I cannot place this folder within this path. I actually have to go outside of the folder MyWebSiteProject.
Not good cause now I have 2 folders one with the .sln folder and the other with all the .aspx pages and these folders are sitting on:
(sln file):
svn://serverName/CIS/MyWebSiteProject
(aspx files):
svn://serverName/cis/myWebSitePages
This really is not ideal cause I am sitting on the root of CIS with 2 folders for really one solution. Now when I try to check the project out I have to check both folders out.
What makes this even worse is when I do check them out I try to open the .sln file and I get an error that it cannot find the corresponding .aspx files. This seems like too much work, is there an easier way or a recommended way of using tortisesvn/subversion with asp.net web projects ?
While I am sure you have TortoiseSVN installed, it sounds like you are using Ahnk or some other VS SCC plugin to add from within VS.
I would suggest not using the plugin to initally add the solution to SVN, but to use TortoiseSVN in Windows Explorer for your initial check in. This will add your solution directory in its original state.
From that point on, you should be able to use the SCC plugin from within VS without trouble.
EDIT
Ok, after your commment I realize that I was not fully understanding the problem.
If you are dealing with a single project, after you create your solution and project, select the solution in Solution Explorer, go to 'file>save solution as' and save the solution inside the directory where your project file is.
Close the solution and go out to Explorer and use Tortoise to add the directory to SVN. If you have multiple projects/sites, just pick one to hold the solution.
Does that make sense? and from that point you should have no problems with ahnk
The key to successfully using Visual Studio with any source control is to put the solution file in the same path as the rest of the project files.
Usually, I will do something like the following:
\Project\Project.sln
\Project\MainWebSite\*.* <-- All web site files (including .??proj here).
\Project\Library\*.*
Then, I manually put \Project\*.* into source control.
Other options exist, as for my recent projects, I have been using:
\Project\SolutionFiles\Project.sln
\Project\MainWebSite\*.*
\Project\Library\*.*
Again, I manually put \Project\*.* into source control.
I generally find that it is better to set up the repositories for my solutions and projects from within Tortoise SVN. Then use whatever VS plugin that you care for to manage the commits of your pages etc. This gives you a little more control and allows you to get your setup correct from the start.

Resources