views:

1123

answers:

2

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?

A: 

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.

magnus
Thanks for this - where did you get the dll from?
Sohnee
Well, it came with VS2010 i think. I didn't explore Areas with separate projects further since they put it in Futures so i went with Area folders instead.
magnus
Okay cool - I'm on VS2008 so I had to get this from Codeplex. Thanks for your help.
Sohnee
NP. Let us know if it works
magnus
A: 

Hi, I had same issue and I was searching for a sulution for a while now... and here it is: http://www.dcs-media.com/Archive/maparearoute-removed-from-aspnet-mvc-2-rc-OR

Maby someone will use it here:)

My error during build was:

Error 1 The "Microsoft.Web.Mvc.Build.CreateAreaManifest" task could not be loaded from the assembly Microsoft.Web.Mvc.Build, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. Could not load file or assembly 'Microsoft.Web.Mvc.Build, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. C:\Users\Jarek\Documents\Projekty\moje\aspmvcareasapp\aspmvcareasapp\aspmvcareasapp.csproj 121 5 aspmvcareasapp
Jarek