Skip to content

ASP.NET Core 2.2 Conversion #8383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SSSikora opened this issue Mar 10, 2019 · 17 comments
Closed

ASP.NET Core 2.2 Conversion #8383

SSSikora opened this issue Mar 10, 2019 · 17 comments
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates question

Comments

@SSSikora
Copy link

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:

false

Any help greatly appreciated.
Regards,

Scott

@Eilon Eilon added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Mar 11, 2019
@Eilon
Copy link
Contributor

Eilon commented Mar 11, 2019

@SSSikora can you share what your CSPROJ files look like?

@Eilon
Copy link
Contributor

Eilon commented Mar 11, 2019

Or, if possible, upload the whole app as a GitHub repo so we can take a look?

@SSSikora
Copy link
Author

SSSikora commented Mar 11, 2019

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

ASP NET Project
Library 1
Library 2

@Eilon
Copy link
Contributor

Eilon commented Mar 11, 2019

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.

@SSSikora
Copy link
Author

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.

@Eilon
Copy link
Contributor

Eilon commented Mar 11, 2019

@javiercn / @pranavkm - any ideas what might cause this?

@pranavkm
Copy link
Contributor

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.

@SSSikora
Copy link
Author

Thank you for the help...

project.assets.zip

@pranavkm
Copy link
Contributor

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.

@SSSikora
Copy link
Author

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.

build failure

@andrestalavera
Copy link

andrestalavera commented Mar 15, 2019

@SSSikora you must remove package reference to Microsoft.AspNetCore.* v2.*

My csproj corrected (inside an ItemGroup tag):

<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)

@SSSikora
Copy link
Author

@andrestalavera - thank you very much for the information and taking the time to look at my issue.

-Scott

@Eilon
Copy link
Contributor

Eilon commented Mar 18, 2019

@pranavkm
Copy link
Contributor

@SSSikora did the migration guides help?

@SSSikora
Copy link
Author

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

@Eilon
Copy link
Contributor

Eilon commented Mar 25, 2019

@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?

@SSSikora
Copy link
Author

SSSikora commented Mar 25, 2019 via email

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates question
Projects
None yet
Development

No branches or pull requests

4 participants