#1
|
|||
|
|||
Problem building ASP.NET application via its project-file.
Hi,
I am using Visual Build Professional (5.1) and have some problems building a VS.NET (ASP.NET) web application via its related project file (so I am NOT using a solution file). Building a standard (non web) application via its related project file is going OK. When running from the command line (Visual Studio .NET 2003 Command Prompt) I verified that I should call 'devenv' with the URL (see below): devenv "C:\Inetpub\wwwroot\MyWebApp\MyWebApp.csproj" /build Release /project "C:\Inetpub\wwwroot\MyWebApp\MyWebApp.csproj" Build FAILED --> "Invalid project" devenv "http://localhost/MyWebApp/MyWebApp.csproj" /build Release /project "http://localhost/MyWebApp/MyWebApp.csproj" Build SUCCEEDED When (building) using the "Make VS.NET" action (which runs 'devenv') from Visual Build Professional I got the message "The remote server returned an error: (403) Forbidden." I used "http://localhost/MyWebApp/MyWebApp.csproj" as filename in the "Project/Solution" tab in the Make VS.NET action. Can anyone maybe tell me how to build an ASP.NET web-application via its project file ? Regards, Henk van der Vaart Build- and Install Architect / Senior Software Engineer Email: Henk.van.der.Vaart@philips.com Philips Business Communications B.V Hilversum, The Netherlands |
#2
|
|||
|
|||
IIS is blocking access (by default) to .csproj files. You need to add .csproj files to the list of extensions that are accessible via http in order to compile your project in the manner you are using.
Obviously, compiling your project using the .sln file would work without the limitations listed above, but it appears you don't want to use this method... |
#3
|
|||
|
|||
kevina,
Thanx for the quick response however I still have some questions/problems left. First of all - where do I check for the accepted extensions. Do you mean the list of 'App Mappings' (via Properties->Home Directory->Configuration)? In this list the .csproj and also .vbproj are listed. Second when I build manually via the DOS commandline by executing "devenv" the build succeeds (so then no error message). Any other clues or clarifying remarks would be appreciated. Henk vd Vaart |
#4
|
|||
|
|||
You said:
<snip>when I build manually via the DOS commandline by executing "devenv" the build succeeds (so then no error message)</snip> Did you execute the same command-line call that Visual Build Pro is executing (available in the log when the 'Display the compiler command-line that is used to build each project' checkbox on the Options tab is checked)? Visual Build Pro also invokes the command-line compiler so it seems most likely there is a difference between what you manually called and what Visual Build Pro called. If that is the case and you are unable to configure your Make VS.Net step to submit a valid command-line call, please provide the exact command-line call you successfully invoked, and we'll evaluate it. Kevin |
#5
|
|||
|
|||
Hi,
The error occurs before the logging of the command-line is done. So I do NOT know what command line is compose by VisBuild Pro. I did verify the composed command-line when building a "normal" (non ASP.NET) .NET application (project). This looks like below (for a normal VB.NET project) Command: "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.com" "C:\Projects\Open BASE\OpenBase.vbproj" /build "Release" /project "C:\Projects\Open BASE\OpenBase.vbproj" So how to continue? Henk. |
#6
|
|||
|
|||
To allow the individual .csproj file to be accessed by the Make VS.NET action, remove .csproj from the Application Mappings for your web application.
Alternatively, specify the project's local .sln file (VS.NET always creates a solution for an individual project when saved from the IDE anyway); when specifying the .sln file, the Make VS.NET action converts each project's http location to a local filename (if it is located on localhost), so it doesn't need to access the file over http. |
#7
|
|||
|
|||
Hi Kevin & Kinook
Thanx for the reactions. I did remove the App Mapping and indeed everything works !!! I even created a VBScript to remove the .csproj / .vbproj script mappings from the IIS VirtualDir. I only have one issue to solve. When building the project it starts with a pre-processing step. I got an error message like below: Pre-processing... http://localhost/directorybrowser/di...r.vbproj...not making target writeable (cannot modify URI files)...not setting properties (cannot update URI files)...not updating version (cannot update URI files)... How can I address this issue ?? Modify security for IIS WebDir ?? Next to this issue I have one additional question (just for curiousity): You mentioned "the Make VS.NET action converts each project's http location to a local filename (if it is located on localhost)". How is this done ?? |
#8
|
|||
|
|||
When building an individual web project file, you won't be able to utilize Make VS.NET capabilities that modify the project (versions, properties, base address, etc.). If you need to do that, you should specify the project's local .sln file in the action instead.
When processing web project(s) in a solution file, the Make VS.NET action goes through various contortions to determine the actual local filename for an http path. See the last section of the Make VS.NET help topic for more details. We do have it on our list to also support this conversion for individual projects in a future release. |
#9
|
|||
|
|||
This doesn't work under 'Default Web Site'
Hi everyone,
I have run into this same problem, and the removal of the extension mappings does work. It just doesn't work for the default web site. I have tested this extensivly and I am unable to build a web project that uses URL references that go through the out-of-the-box default web site. However, I can create a new web site, set it to use the default port (80) and then change the default web site to be using a different port. When I have the same .sln file referencing a web project via 'localhost/virtual directory', the build will always fail if the localhost is set to be using IIS' default web site. I have removed the file extension mappings, added MIME types and everything. Is there any way to get web projects to build through the IIS 6.0 out-of-the-box default web site? Please let me know if anyone has run into this problem and found an answer. Thanks in advance Thomas |
#10
|
|||
|
|||
Hi Thomas,
Below my proven build scenario for ASP.NET projects (for 'Default Web Site' / IIS 5.0) : 1. Delete ASP.NET related VSWebCache sub-folder 2. Create Virtual Directory (target is folder with ASP.NET project). 3. Delete script-maps for .vbproj / .csproj for web-site related virtual folder. 4. Perform VS.NET build step with "http://localhost/%PROJ_VIRTUALDIR%/%PROJ_FILENAME%". PS - I did use the project filename (so NOT the solution filename). - What failure/error message do you get ? - Maybe IIS 6 behaves different ? Regards, Henk. |
#11
|
|||
|
|||
I took a clean W2K3 install and was able to build without any problems. Here were the steps I followed:
1) Added the Server role to Windows (enabling server extensions and ASP.NET). 2) Installed VS.NET 2003. 3) Installed VBP 5.3. 4) Opened VS.NET and created a C# ASP.NET Web App named WebApplication1. 5) Built the new project in VBP via the Make VS.NET action, using the sln file (C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\WebApplication1\WebApplication1.sln) and project file ( http://localhost/WebApplication1/WebApplication1.csproj), configuring the step to increment the file version and set the base address. Did you enable server extensions and ASP.NET when configuring the Server role? Is there anything else nonstandard about your setup? |
#12
|
|||
|
|||
FrontPage Server Extensions are installed as is the ASP.NET component of the server. I tried the idea from the previous post where you remove the VSWebCache folder, and this did not work. There is nothing else odd about my project or my machine. I have removed the .csproj script extension, added a MIME Type to associate the file. I just erased the VSWebCache folder for my username, and it still gives me a 401 error (Unauthorized). I am running a clean win 2k3 server box that sounds pretty much exactly the same as what the admin descfribed. Does anyone have any ideas?
__________________________________________________ So I went back and thought that Server Extensions were the reason the builds were failing. It turns out that if I go to 'configure FP Server Extensions' and configure the machine to allow anonymous access, I do not get this 401 Unauthorized error. Any ideas on how to get the build to work without allowing anonymous access to my entire machine? Last edited by thomasst; 04-05-2004 at 12:26 PM. |
#13
|
|||
|
|||
VBSscript
Can you share the VBScript you created to VBScript to remove the .csproj / .vbproj script mappings from the IIS VirtualDir?
|
|
|