ASP.NET MVC 2 Areas and AfterBuildCompiler

2019-06-11 02:16发布

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?

1条回答
Viruses.
2楼-- · 2019-06-11 02:43

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.

查看更多
登录 后发表回答