Last post Oct 24, 2011 06:16 AM by faisalnk
Oct 19, 2011 06:05 AM|faisalnk|LINK
We have been doing build and deployment using CruiseControl.NET, Poweshellscript.
We have small web application which contains few aspx files and .cs files.
I created a package using following msbuild command as per
vishal Joshy's blog
MSBuild "C:\Myproject.csproj" /T:Package /P:Configuration=Release;PackageLocation="C:\MyPackage\Package.zip"
After that I run following deployment code as per
Package.deploy.cmd /y /M:https://localhost:8172/MsDeploy.axd
The deployment also executed successfully
But when I browse the one of the application page getting following error
The file '/Mypage.aspx.cs' does not exist.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Mypage.aspx.cs" Inherits="MyPage" %>
When I checked I could see the package.zip file contains the project without .cs file( which is expected) but aspx files refer.cs file( which is not expected). aspx files should refer dll to get code behind.
Can you please let me know what gets wrong from my side?
In addition to that what is the best way to package and deployment using automation script(I can use, command line, poweshell commands but NOT User interface such as Visual Studio or Import project from IIS etc) as we are doing build and deployment
automation without any user interactions.
I will definitely appreciate any help from your side.
Thanks & Regards,
Oct 21, 2011 04:45 AM|VishalRJoshi|LINK
The steps you have outlined look reasonable. Can you try reproducing this using following different steps:
I think the issue is that CodeFile attribute should ideally not exist in a Web Application Project, it should be CodeBehind. My suspicion is that this was an issue which got created when there was a conversion from WebSite project to Web Application project.
You can also try to Right click on the project file and say "Convert to Web Application" (or manually change the attributes :-))and then try again.
Hope this helps.
Vishal R. Joshi | http://vishalrjoshi.com |
Oct 24, 2011 06:16 AM|faisalnk|LINK
Hi Vishal Johi,
Sorry for the delayed reply as we had some urgent bug fixing had to be done on last couple of days. So, I was unable to test the solutions which you suggested.
As you suggested, I converted to web application by rightclicking on the project, but that didn't help me.
1.Create a new web application project in VS. Try to Package using right click context menu and deploy using deploy.cmd file with a /Y switch. You can skip the /M switch for now.
I couldn't find a context menu with deploy option.
2.Create a new web application project in VS and then try your steps again. I created a new webapplication and followed the steps as explained in your article mentioned in the previous post. The issue persists.
But when I created a new website application everything working as expected.
Instead of MSBuild I used Aspnet_compiler.
Aspnet_compiler -v /ABC.SSO -p "C:\NEWAPP\ABC.SSO" -u "C:\TargetPackage"
As per my understanding
we can't publish ASP.NET Web application using MSBuild tool. If it is wrong something wrong withmy comfiguration . Currently we are using Visual studio 2010
Thank you very much, I appreciate this help.