Search code examples
asp.netasp.net-mvcareas

ASP.NET MVC 2 Areas and AfterBuildCompiler


I am just trying out Areas in ASP.NET MVC 2 and I've hit a small issue.

I've added the appropriate lines to my project file:

 <Target Name="AfterBuild" DependsOnTargets="AfterBuildCompiler">
    <PropertyGroup>
      <AreasManifestDir>$(ProjectDir)\..\Manifests</AreasManifestDir>
    </PropertyGroup>
    <CreateAreaManifest AreaName="$(AssemblyName)" AreaType="Child" AreaPath="$(ProjectDir)" ManifestPath="$(AreasManifestDir)" ContentFiles="@(Content)" />
  </Target>

But the problem I have is that I get the following error:

The target "AfterBuildCompiler" does not exist in the project.

I think I'm missing something obvious - any suggestions?


Solution

  • When i got that error it was because the Microsoft.Web.Mvc.Build.dll was missing in C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies

    Don't know if it's the only problem though.