Hello,
I have upgraded a solution from System.Web.Web.* 1.0.0.0 to 2.0.0.0
Since the upgrade the RazorGenerator is failing to compile the pre-compiled views with the following error:
Could not load file or assembly '[removed]\RazorGenerator.Core.v1.dll' or one of its dependencies. The system cannot find the file specified
That's a weird error because if I add RazorGenerator.Core.v1.dll then I would have to add System.Web.Web.* 1.0.0.0 again.
At the moment I have a pretty standard RazorGenerator.targets:
oject xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RazorGeneratorMsBuildPath Condition=" '$(RazorGeneratorMsBuildPath)' == '' ">$(MSBuildThisFileDirectory)\RazorGenerator.MsBuild.dll</RazorGeneratorMsBuildPath>
<RazorViewsCodeGenDirectory Condition=" '$(RazorViewsCodeGenDirectory)' == '' ">$(MsBuildProjectDirectory)\obj\CodeGen\</RazorViewsCodeGenDirectory>
<CompileDependsOn>
PrecompileRazorFiles;
$(CompileDependsOn);
</CompileDependsOn>
</PropertyGroup>
<UsingTask AssemblyFile="$(RazorGeneratorMsBuildPath)" TaskName="RazorCodeGen" />
<Target Name="PrecompileRazorFiles" Returns="@(FilesGenerated)">
<ItemGroup>
<RazorSrcFiles Include="**\*.cshtml" />
</ItemGroup>
<RazorCodeGen ProjectRoot="$(MsBuildProjectDirectory)"
FilesToPrecompile="@(RazorSrcFiles)"
CodeGenDirectory="$(RazorViewsCodeGenDirectory)"
RootNamespace="$(RootNamespace)">
<Output TaskParameter="GeneratedFiles" ItemName="FilesGenerated" />
</RazorCodeGen>
<ItemGroup>
<Compile Include="@(FilesGenerated)" />
</ItemGroup>
</Target>
</Project>
I have the following files withing the same folder than RazorGenerator.targets:
Microsoft.Web.Infrastructure.dll v1.0.0.0
RazorGenerator.Core.dll v2.3.4
RazorGenerator.MsBuild.dll v2.3.4
System.Web.Helpers.dll v2.0.0.0
System.Web.Mvc.dll v4.0.20710.0 (I tried with 2.X too but got same error)
System.Web.Razor.dll v2.0.0.0
System.Web.WebPages.Deployment.dll 2.0.0.0
System.Web.WebPages.dll v2.0.0.0
System.Web.WebPages.Razor.dll v2.0.0.0
My question is: what's the error? why is RezorGenerator looking for RazorGenerator.Core.v1.dll?
Thanks,
John