1
votes

I am getting this cryptic error after updating my ASP.NET MVC Service running in Service Fabric. After a lot of faffing around with the actual upgrade I managed to get it running on my local Service Fabric on my machine.

I am now trying to deploy it to an actual Service Fabric cluster. I am now getting errors such as:

Error RZ3501: Invalid tag helper bound property 'RouteValues' on tag helper 'Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper'. 
'Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeNameAttribute.DictionaryAttributePrefix' must be null unless property type implements 'IDictionary<string, TValue>'.
(0,0): Error RZ3501: Invalid tag helper bound property 'RouteValues' on tag helper 'Microsoft.AspNetCore.Mvc.TagHelpers.FormActionTagHelper'.

Note that I have not changed any code during the upgrade of the ASP.NET MVC service to version 2.0

This is a sample of how I used TagHelpers:

@{
    IDictionary<string,string> routeData = SpecialMethodThatCalculatesRouteData();
}

<a asp-route="MyRoute" asp-all-route-data="@routeData" >

This code worked fine before the upgrade.

Has anybody stumbled upon this?

Thanks

EDIT: These are the references I have in the csproj file:

<PackageReference Include="CompressedStaticFiles" Version="1.0.3" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.0" />
<PackageReference Include="Microsoft.ServiceFabric" Version="5.7.198" />
<PackageReference Include="Microsoft.ServiceFabric.AspNetCore.WebListener" Version="2.7.198" />
<PackageReference Include="Microsoft.ServiceFabric.Data" Version="2.7.198" />
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="2.7.198" />
<PackageReference Include="Microsoft.ServiceFabric.Services.Remoting" Version="2.7.198" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.0.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric.Native" Version="1.0.0-beta2" />
<PackageReference Include="NETStandard.Library.NETFramework" Version="2.0.0-preview2-25405-01" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="React.AspNet" Version="3.1.0" />
<PackageReference Include="Microsoft.Azure.DocumentDB" Version="1.17.0" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="2.0.0" />

EDIT: More info. I had to add these tasks to my build definition in VSTS to get the project to compile

snip from VSTS build definition

3
Note that this error happens when I deploy to the live cluster through VSTS Build and Release management. If I deploy directly to the cluster from Visual Studio 2017 IDE it works fine. I cannot understand what's the difference. Could it be something related to Nuget install on the VSTS build?ZeroOne
can you check you have package reference for TagHelpers still available after upgrade in the project file, if its available remove and seeShiwanka Chathuranga
@ShiwankaChathuranga No, I don't have that reference. I added the references in my csporj file in the main questionZeroOne

3 Answers

0
votes

I just ran into the same problem, setting the vsts build to 'clean' seemed to resolve it.

0
votes

I had a global.json file pointing against an old SDK (1.1), removing that file solved this problem for me.

0
votes

Turns out that our build agent had VS version 15.2 and by upgrading the build agent to the latest version 15.5, that solved the problem.