I'm attempting to build a ASP.NET website using MSBuild - specifically the AspNetCompiler tag. I know that, for my project, I need to add some references. Within Visual Studio I have several references, one is a project reference and the others are some DLLS (AjaxControlToolkit etc). I'm happy not referencing the project and referencing the DLL instead - however I just can't work out how to add a reference. I've looked up and down and this is what I've found so far:
<Target Name = "PrecompileWeb">
<AspNetCompiler
开发者_开发知识库 VirtualPath = "DeployTemp"
PhysicalPath = "D:\AutoBuild\CruiseControl\Projects\Websites\MyCompany\2.0.0\WorkingDirectory\VSS"
TargetPath = "D:\AutoBuild\CruiseControl\Projects\Websites\MyCompany\2.0.0\PreCompiled"
Force = "true"
Debug = "true"
Updateable = "true"/>
</Target>
Also - I've picked up this bit of code from around the web somewhere, which I thought might help:
<ItemGroup>
<Reference Include="My.Web.DataEngine, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\AutoBuild\CruiseControl\Projects\Components\My.Web.DataEngine\bin\Debug\My.Web.DataEngine.dll</HintPath>
</Reference>
</ItemGroup>
What I want to do is add a attribute to the AspNetCompiler tag, something like:
References="@(Reference)"
but MSBuild isn't very happy about this.
I've been a bit stuck in not being able to find decent references on doing this anywhere: so I'd really apprechiate some pointers or reference material etc. (or just the answer!)
Thanks for you help.
-tom
The aspnet_compiler tool doesn't have a reference property.
Have you looked at using Web Deployment Projects (2005 version)?
You can add references to assemblies used during the compilation of an ASP.NET application by adding to the <assemblies>
element, under <compilation>
if your web.config. For example:
<compilation targetFramework="4.6.2" debug="true">
<assemblies>
<add assembly="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
Read more here: https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/bfyb45k1(v=vs.100)
精彩评论