0

I am using VSTS 2008 and I am using Create new ASP.Net web site and using default settings/automatically generated files.

My questions are,

  1. How to use command line script (msbuild) to build the ASP.Net web site automatically?
  2. I want to build the web site into a DLL which could be easily copied to target IIS server later.

Any samples or quick answer how to do these tasks in msbuild?

EDIT1: There is no sln and csproj file in the web site folder. Here is the link.

http://tinypic.com/view.php?pic=dra5jp&s=5

Here is how I create in VSTS 2008.

http://i40.tinypic.com/208zfxv.jpg

2 Answers 2

1

I use VS.NET 2005 and using this command to build my asp.net web application in release mode :

cd "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\"
MSBuild "C:\Projects\MyProject.csproj" /t:Rebuild /p:Configuration=Release /verbosity:quiet /p:WarningLevel=0
Sign up to request clarification or add additional context in comments.

8 Comments

@Canavar, I can not find any project file (.csproj) in the web site folder. Are you creating ASP.Net web application or creating New ASP.Net Web Site? My question is dealing with creating new ASP.Net Web Site.
I'm using Web Application, but , did you look at the "C:\Documents and Settings\USER_NAME\My Documents\Visual Studio 2005\Projects" directory for your *.csproj file ?
I suppose for web sites there is a *.sln file in "C:\Documents and Settings\USER_NAME\My Documents\Visual Studio 2005\Projects\project_name\" you can use it to build your web site.
@Canavar, I have tried again, but there is no sln or csproj files in web site folder. Please check the EDIT 1 section of my original post for my screen snapshots. Any ideas what is wrong?
@George2 : I can not open your images in office :( but, visual studio stores your solution file into your Documents folder, not in your project folder. I'm not sure you looked at that folder.
|
1

"Web Applications" have .csproj files, "Web Sites" do not. http://damieng.com/blog/2008/02/07/web-site-vs-web-application

You want to compile it with aspnet_compiler.exe in the bin directory C:\windows\framework\version

http://msdn.microsoft.com/en-us/library/ms178466.aspx

Easier way is to use deployment projects or the "Publish Web Site" command in Visual Studio. (Right Click on website)

http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project-support-released.aspx

3 Comments

@Deviant, my purpose is using command line to automatically build/deploy all web site needed files (DLL for code behind file, aspx and images). Do you have any advice for solution in my situation?
I have another idea, could my task be completed easier if I create web application other than creating web site?
Yes it could, Then you could use Canavar's way , you'd have a csproj

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.