Hello All,
I'm hoping someone can help me with the following error:
3>obj\Debug\netcoreapp3.0\NEP.Portal.RazorTargetAssemblyInfo.cs(16,12,16,92): error CS0579: Duplicate 'Microsoft.AspNetCore.Mvc.ApplicationParts.ProvideApplicationPartFactoryAttribute' attribute
I converted a 2.2 solution that consists of two .NET Core libraries and a single front-end ASP.NET Core project. I'm not sure what is causing this error and after research if I insert the following line in my csproj it will compile but fails to server any pages all resulting in a 404 error:
Any help greatly appreciated.
Regards,
Scott
@SSSikora can you share what your CSPROJ files look like?
Or, if possible, upload the whole app as a GitHub repo so we can take a look?
Thanks for the response Eilon. Below are the csproj files from the two libraries and the ASP.NET Core app. I've gone as far as to create all three projects in VS2019 using file new and then copying all of the assets into each and the problem remains. It's strange because it's a relatively small and simple application. Appreciate your help with this.
Tried to paste in csproj...but that didn't work. Looking for alternate method now. New user, sorry. The first is the ASP.NET Core project and the second two are my libraries.
Again, thank you so much for any information you might have,
Scott



So you're trying to migrate from ASP.NET Core 2.2 to ASP.NET Core 3.0 Preview 3? It looks like some of the package references are still to 2.2, such as Microsoft.AspNetCore.Identity.
Thanks for another reply. I see what you mean and have removed references to that Identity package but the problem persists. I think it may have to do with the Telerik controls. When I expand them in the dependencies that show asp net core 2.1.6. Could that have something to do with it? Although I am using them with the 2.2. project so I don't see why that would be a problem.
@javiercn / @pranavkm - any ideas what might cause this?
Could you attach the obj\project.assets.json for the Web app? Perhaps something's pulling in a 2.x version of MVC \ Razor and not getting overriden by the targeting pack.
Thank you for the help...
Could you confirm this is from the project that targets the WebSDK (Microsoft.NET.Sdk.Web). I think it's called NEP.Portal? I don't see any of the Telerik specific package references in it, so just making sure I'm looking at the right file.
If it is the right one, could you include the preprocessed output for the file: dotnet msbuild /pp:out.txt and attach the out.txt that MSBuild spits out. The project.assets.json doesn't indicate any reason for you to see the build error.
A zero-byte file is generated and the error I'm getting in VS appears in the command prompt as the attached photo shows. Thank you, Pranav.

@SSSikora you must remove package reference to Microsoft.AspNetCore.* v2.*
My csproj corrected (inside an ItemGroup tag):
xml<PackageReference Include="Faker.Net" Version="1.1.1" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.7.0-beta2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.0.0-preview3-19153-02" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.0.0-preview3-19153-02" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-preview3-19153-02" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0-preview3.19153.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="1.0.172" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<!--
<PackageReference Include="Microsoft.AspNetCore.CookiePolicy" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Localization" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Localization.Routing" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Localization" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.TagHelpers" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Razor" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
-->
I had the same error, I corrected it as well
@Eilon that mean that the v3 included what meta package?
I do not want to reference 1000 packages that I do not need... (It's going to weigh my apps for nothing)
@andrestalavera - thank you very much for the information and taking the time to look at my issue.
-Scott
@SSSikora we have some migration information at the following links:
@SSSikora did the migration guides help?
I had previously found those guides and updated the app, but I believe my problem is that the Trlerik components are not yet working under 3.0 and so I have set this aside for now until they do.
Thank you to all who took time to comment. I am greatly looking forward to working with this next release.
-Scott
@SSSikora got it, thanks for the update. Should this bug be closed, or is there still any pending action for the ASP.NET Core team?
I don’t believe the problem lies with ASP.NET Core so the issue can be closed. Thanks again for the help.
From: Eilon Lipton notifications@github.com
Sent: Sunday, March 24, 2019 11:05 PM
To: aspnet/AspNetCore AspNetCore@noreply.github.com
Cc: Scott S Sikora ssikora@northeastprecast.com; Mention mention@noreply.github.com
Subject: EXTERNAL: Re: [aspnet/AspNetCore] ASP.NET Core 2.2 Conversion (#8383)
@SSSikorahttps://github.com/SSSikora got it, thanks for the update. Should this bug be closed, or is there still any pending action for the ASP.NET Core team?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/aspnet/AspNetCore/issues/8383#issuecomment-476039173, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHDoSAJKIJgy35zzd7rchLGXvhrbSnFNks5vaDzGgaJpZM4bnPZB.