i am compiling the asp.net web application page by page using "gmcs" command in Mono.
But i want to compile the whole asp.net website at once using Mono command.
For ex:
gmcs /t:library /out:bin/AJAX.dll -r:System.dll -r:System.Web.dll -r:bin/AjaxControlToolkit.dll Default.aspx.cs Default.aspx.designer.cs
I do not want to do like the above one, instead i want to compile the whole folder containing files at once.
Plz let me know.thanks in advance
I used to run xbuild on projects created using Visual Studio as IDE. Worked perfectly! I'm not sure if MonoDevelop generates a .csproj file for your web application but that's the best way to compile ASP.NET, which, however, was supposed to be compiled automatically by xsp on the first request
Related
I've created a blank solution in VS2019. Using the option "add existing web site" I've added a website to the solution which was built in VS2010. Normally, after that, I was used to add a Web Deployment Project to the solution, to compile all the code in one dll, and upload the result to the web server.
But this kind of project does not seem to be compatible anymore with the newer versions of VS.
Is there any way to get a similar compiled result in VS2019?
I found an alternative.
It is to convert the [asp.net web site] to an [asp.net application]. The asp.net application has a publish feature, which can be used to generate an output folder with the compiled application inside, with the aspx pages and a single dll.
I suggest to follow the steps described here to convert the asp.net web site to asp.net application:
https://learn.microsoft.com/en-us/previous-versions/aa983476(v=vs.140)
I have recently upgraded my .Net 3.5 solution containing some C# code projects and a ASP.net web site project to VS2010 (from VS2008). It is building and running fine inside VS, but I get some problems when trying to build it on my server with MSBuild 4.0 via TeamCity. It seems like the projects that are referenced from the web site are not built. This was all working fine before I upgraded to VS2010, MSbuild 4.0 and Windows SDK 7.1.
Inside the msbuild script that I use to build from teamcity I have defined project references for the web site like this:
<ProjectReference Include="..\src\trunk\DataAccess\DataAccess.csproj">
<Project>{C43242F4-7286-4BEC-9A27-001D6FC14860}</Project>
<Name>DataAccess</Name>
</ProjectReference>
When I try to run the build script I get an error message saying that it could not find the dll file when trying to copy it from the bin folder of the referenced project into the bin folder of the web site. This is happening because the referenced projects are in fact never built at all (No bin folder exists in the project dir).
Does anyone have a clue what may cause this? I am not very experienced with MSbuild, so I may have overlooked some important stuff. Is it not so that MSbuild will automatically try to build the referenced projects if no project output is existing?
Will be thankful for any help!
I would need some more info to guide you on this, but off the top of my head try adding
/toolsversion:3.5
to your msbuild call.
I found another post on this website describing your exact same problem. I also ran into this same problem too.
This blog on the MSDN Website describes the problem and the work-around. Basically it's a limitation of solution files which are not in an MSBuild format, but just a fancy text file. And the real thing is, that the dependencies need to be specified in the project files them selves not the solution file. ahhh... just read the link it explains it a hundred times better than my answer here.
I am just getting started with Silverlight and have recently added a Silverlight project to an established solution. In this particular scenario my solution included an existing ASP.NET web site which Visual Studio kindly offered to integrated my Silverlight application into, which I accepted.
So everything is fine and all, and the Silverlight XAP is being copied to the web site's ClientBin directory when i was buiding solution through visual studio, But
I want same thing through using nant script when i am used nant script that time all project in the solution are build but recenty added silverlight website do not create XAP's in ClientBin dierctory.
I m using following script :-
target name="build" description="compiles the source code">
exec program="${framework::get-framework-directory(framework::get-target-framework())}
\msbuild.exe" commandline="MY.sln" workingdir="ProjectFolder" />
what are the ways ??
You could reverse-engineer the MsBuild scripts used to build Silverlight apps and .Xap files, the files will be located in:
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v3.0
Your msbuild compilation should be creating the XAP file in the Bin\Debug folder of the silverlight project. You can simply use the Nant copy task to move it to the Web project's ClientBin folder.
I have finally finished my web site. I published it, and I was surprised at the results. Although the App_Code compiled into a single DLL file, every page's code behind compiled into its own DLL file. How do I make it so that it is one DLL file?
Also, is it possible to compile everything (SubSonic, AJAX, etc.) into that same single DLL file?
You might prefer to use the web application project style for that.
You can use ILMerge to merge assemblies into one.
The way we do it is by adding a deployment project to our site:
http://msdn.microsoft.com/en-us/asp.net/aa336619.aspx
To accomplish this you will have to covert your project into a Web Application Project (Supported in Visual Studio 2005 SP1 and Visual Studio 2008).
The process of converting is not that hard, but you will need to move everything out of the app_code folder, as WAP (Web Application Projects) projects do not have code inside app_code.
Once you do this, everything inside your project is compiled into a single DLL file, any external assemblies are still contained in their own DLL files though, but there are options around that as well.
We use build scripts for our websites and run the aspnet_merge.exe from the command line. Here's the MSDN page: http://msdn.microsoft.com/en-us/library/bb397866.aspx
What is the difference between CodeFile="file.ascx.cs" and CodeBehind="file.ascx.cs" in the declaration of a ASP.NET user control?
Is one newer or recommended? Or do they have specific usage?
CodeBehind: Needs to be compiled (ASP.NET 1.1 model). The compiled binary is placed in the bin folder of the website. You need to do a compile in Visual Studio before you deploy. It's a good model when you don't want the source code to be viewable as plain text. For example when delivering to a customer to whom you don't have an obligation to provide code.
CodeFile: You provide the source file with the solution for deployment. ASP.NET 2.0 runtime compiles the code when needed. The compiled files are at Microsoft.NET[.NET version]\Temporary ASP.NET Files.
I'm working with an Application Project in Visual Studio Express 2012 For Web and using .NET 4.0. In the code behind files for my login and change password pages I found a situation where I needed both CodeBehind and CodeFile in the declaration.
If I don't add a code file reference like
CodeFile=login.aspx.cs
The web page doesn't parse and the browser displays a parser error. It doesn't matter whether I compile the project or not.
If I don't add a code behind reference like
CodeBehind=login.aspx.cs
References to Security classes like MembershipUser fail both at compile time and when attempting to use intellisense with an error like "The type or namespace MembershipUser cannot be found". I have added a reference to System.Web.ApplicationServices as required by the .Net 4.0 framework.
I should add that these troublesome files are running in an application within the website created using the IIS Application tool. When I open the website from Visual Studio I have no difficulty with parser errors or reference errors. This confusion only occurs when I open the application as a project in Visual Studio.
Codebehind file need to compile before run but in src we dont need to compile and then run.. just save the file.