How to run a docsite?

Topics: DocSites, General Discussion, General Questions
Aug 22, 2007 at 6:34 PM
Building the docsite takes me about 45 minutes for my program. So my question is how do I run the website version of it? I am using the latest 1.7.0 now.

I have tried publishing but I get that error:

Error 54 Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0'. FootPrintsAutomationService-WebsiteDocumentation

I also tried opening the default.aspx in firefox but it says:
XML Parsing Error: not well-formed
Location: file:///C:/Dev/FootPrintsAutomationService/FootPrintsAutomationService-WebsiteDocumentation/Default.aspx
Line Number 1, Column 2:<%@ Page Language="C#" MasterPageFile="~/DocSite.Master" AutoEventWireup="true" Codebehind="Default.aspx.cs" Inherits="FootPrintsAutomationService_WebsiteDocumentation.Default" %>
-^
Coordinator
Aug 22, 2007 at 7:34 PM
Edited Aug 22, 2007 at 7:35 PM
Hi,

I've never seen this issue before. Normally, you can just press F5 and it will start Visual Studio's web server and run the site like any other Web Application project.

The assembly that appears in the error is not used or referenced by DocProject in particular, so I'd imagine that you'd get that same error if you published a normal Web Application project in the same manner. Can you verify this?

If it's definitely a problem with DocProject, can you reproduce it in a simple DocSite and send me the project?

Thanks,
Dave
Aug 22, 2007 at 8:01 PM
Edited Aug 22, 2007 at 8:02 PM
Yea I can do that, im going to test it some more. When I searched for the Microsoft.Windows.CommonLanguageRuntime error, I recieved a bunch of messages saying that it is because of a security bug in VS 2005, which is verified by microsoft. It somehow deals with a problem when there are 2 projects in a solution(and one relies on the other). Im trying the F5 solution right now, but so far its acting like last time where it is trying to start and just hangs on an hour glass. Although VS2005 is running at 100% right now... Ill let it go longer, granted that it normally takes me 45 minutes to compile the help. I also wanted to have a version of the web help somewhere static so I didnt have to wait 45 minutes to compile when sum1 wanted to view them(as a web site).

If F5 works I wont bother with microsoft's bug. So my question is, is there a way to view it as a website outside of VS2005? some sort of settings to make a release build work on its own?

BTW, davedev you are always quick with replys and helping out, I appreciate that very much.

Thanks again,
Brad
Aug 22, 2007 at 8:07 PM
UPDATE F5 did go through, I just had to wait longer! so good news there. Now how do you build a release with it? Note that I have never made a asp.net program or published one, so I could just be asking a fairly easy/newbieesque question :).
Coordinator
Aug 22, 2007 at 9:12 PM
Hi Brad,

I'm glad to hear that it worked for you.

FYI, you can press Ctrl+F5 to run the website without having the debugger attached. I've heard of problems with the debugger taking a long time to start (like 45 seconds+) so that may be the reason for the long wait that you experienced.

DocProject supports partial builds so that while the solution is open the help will not be generated again unless the project references have changed. Unfortunately though you're probably not going to be able to decrease the amount of time that a build does take. The pages generated by Sandcastle actually are static pages. The DocSite is what's dynamic and that should build instantaneously.

But if you want to disable the help build from running at all it's easy:

  1. Find your DocSite in Solution Explorer.
  2. Right-mouse click the project and select Unload Project. The project is unloaded.
  3. Right-mouse click again and select Edit ... to open the project file in Visual Studio.
  4. In the first line change the DefaultTargets value from BuildHelp to just Build.
  5. Save your changes and close the file.
  6. Right-mouse click the project in Solution Explorer and select Reload Project.
Now when you build it will only build the assembly output. To build the help again you don't have to reverse the changes if you're using Visual Studio Standard+. Instead, you can simply use the Rebuild command on the Build menu (also available when you right-mouse click the project in Solution Explorer).

- Dave
Aug 22, 2007 at 9:18 PM
Right I did that already, but I dont know how to run the web application standalone? I tried Ctrl+F5 and it runs my normal program... Is there a way to run it outside of visual studio? Where I can just double click the file, or open it in firefox/IE?

Ill tell ya though, im just happy to see it, all that documenting and finally get to visual it :).

Hey thanks again dave, always a help.

--Brad
Coordinator
Aug 22, 2007 at 9:21 PM
Hi Brad,

Sorry, I forgot to ask what you meant by "release" build. Technically speaking, as soon as you build your DocSite for the first time it's ready for release. It's just a matter of deployment then:

How to: Publish Web Application Projects
http://msdn2.microsoft.com/en-us/library/aa983453(VS.80).aspx

- Dave
Coordinator
Aug 22, 2007 at 9:34 PM
Edited Aug 22, 2007 at 9:35 PM
Hi Brad,

Ok, I understand what you're looking for now. The publish link that I posted should help.

An ASP.NET web application must be published to a server like IIS. Most likely you have a version of Windows that has a built-in version of IIS to which you can publish your site. For your entire organization you'll want to publish it to an intranet server instead though.

I understand that by "static" you were simply looking for a place where people could browse the HTML files. That's actually possible by simply copying the HTML files to a directory on its own. But if you want the full TOC and Index (and all of the new features that I have yet to publish for the next release of DocProject), then you'll have to publish the DocSite to a server.

You can use the Sandcastle/Deployment Plug-in (you must choose this in the first step of the New Project Wizard when you create a new DocSite) to have the site automatically deployed after each build. Once the application is created in IIS you must setup the initial directory structure on the server and copy the static items such as the Icons, Styles and Scripts folders, for example. But after that it's all automatic.

HTH

- Dave
Aug 22, 2007 at 9:52 PM
Edited Aug 22, 2007 at 9:54 PM
Thats EXACTLY what I was looking for. Sorry my understanding of ASP.NET and websites are just plain in the garbage. Im definitly going to go through that and hopefully get this up and running. Tomorrow morning looks good! :)

Thanks dave!

--Brad

EDIT: By the way I did do that publish but it gave me the "
Error 54 Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0'." error. So I will go over that tommorow and find out exactly what is going on there....
Coordinator
Aug 22, 2007 at 9:56 PM
NP. If you need further assistance let me know.

- Dave
Oct 2, 2007 at 11:01 PM
When another Windows application is referenced by a DocProject application, we get this: Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0'." error. If you build that Windows Application into .dll rather than .exe and then reference it, it will work OK! That means DocProject application only like to reference Assembly (.dll). Hope this helps.
Coordinator
Oct 2, 2007 at 11:19 PM
Hi,

DocProject works fine with .exe assemblies, WinForms and Console applications. The problem when you see that error is that Visual Studio (or it may be MSBuild - not sure) does not allow project references to Click Once applications. Simply reference a Click Once assembly (.exe) as an external source and it should work fine.

- Dave