Aspnetcore.docs: Not compatible with net461

Created on 1 Mar 2018  Â·  15Comments  Â·  Source: dotnet/AspNetCore.Docs

Tried creating new projects as described and adding the prerequisite packages only to receive compatibility errors.

Downloaded the sample source code and opened it in VS2017 only to immediately receive compatibility errors.

All 15 comments

@newgui Is there any particular doc you're following? If you provide a link to the sample code, I can dig into this for you.

Hi Scott, Thanks for responding. I am following this article: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/windows-service?tabs=aspnetcore2x

Step 1 is to install Microsoft.AspNetCore.Hosting.WindowsServices. When I attempt to do that, I get an error saying that it is not compatible with net461 which the prereqs indicate as required.

So, I then just downloaded the source code from https://github.com/aspnet/Docs/tree/master/aspnetcore/host-and-deploy/windows-service/sample and loaded it up in VS2017 and get a page full of compatibility errors.

I'm sure it's my inexperience here but I'm just not sure what to do next.

@newgui Thanks for the info! I'm looking into this for you.

@newgui If you don't mind, can you include the compatibility errors you're seeing?

"Install" might not be the best choice of words, since what the app will need is a package reference to Microsoft.AspNetCore.Hosting.WindowsServices.

@newgui With regard to running the sample app that accompanies the topic, do you have a recent version of VS (15.3 or later; 15.5.7 is latest) with the ASP.NET and web development and .NET Core cross-platform development workloads installed?

When we did the update on this topic, I pulled the sample down, and it built ok. Therefore, I think a tooling (VS) setup issue is to blame.

I had a slightly earlier version than the latest (15.5.7) back then, so what I'm doing now is taking my VS to 15.5.7 to confirm the sample loads, restores, and builds with latest VS. I'll ping back with the result.

[EDIT] Yes, the sample restores and builds with 15.5.7. @newgui Use the VS installer to make sure your VS has those two workloads installed. Keep us posted.

[EDIT 2 :smile:] @scottaddie I recommend that the "install" language be changed over to "add a package reference" language. Might also be a good idea to add something about the VS workloads required. That type of language can be seen here :point_right: https://docs.microsoft.com/aspnet/core/mvc/razor-pages/?tabs=visual-studio#aspnet-core-20-prerequisites

I can confirm that the sample app also builds for me with VS 2017 15.5.7 and the 2 workloads specified by @guardrex.

@guardrex I'm going to create an issue to make some updates to this doc. I see a few other things that need attention.

Thanks for the reply! I am upgrading VS now and will see how it goes...

OK... I update VS to the latest version and the sample project will load and run.

However, as indicated in the document that I am following the ASP.NET Core Application (.NET Framework) template is no longer available. Is there another that I should use or is there a way to get that one back?

OK... I believe I have this figured out now. Thanks for all of your input.

I think it would be (maybe :smile:) ...

Visual C# > .NET Core > ASP.NET Core Web Application

Set 1st DDL to ".NET Framework" (leave the 2nd DDL on "ASP.NET Core 2.0") ... and select the "Empty" template.

I also noticed that the template indicated in the doc is incorrect. This will be addressed in https://github.com/aspnet/Docs/issues/5578.

Hi Scott,

I seem to be stuck again. I have created the projects as described here: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/windows-service?tabs=aspnetcore2x#tabpanel_SENY+PN+lu_aspnetcore2x

When running in VS I am able to debug the project and browse to the API.

I have also used the sc command to create and start the windows service. However, when running as a Windows Service I am unable to browse to the url. I get either a 500 or 400 error.

Can you provide any direction? Here is a link to my project: https://www.dropbox.com/s/n3svj2yjtedpmgy/DocumentsApi.zip?dl=0

Thanks,

Kerry

From: Scott Addie [mailto:[email protected]]
Sent: Friday, March 02, 2018 10:33 AM
To: aspnet/Docs Docs@noreply.github.com
Cc: newgui kerryg@newgui.net; Mention mention@noreply.github.com
Subject: Re: [aspnet/Docs] Not compatible with net461 (#5577)

Closed #5577 https://github.com/aspnet/Docs/issues/5577 .

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/aspnet/Docs/issues/5577#event-1501511829 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABGF0cOB5-ASXEvocQNG9oCkr4-zilb8ks5taXRKgaJpZM4SYc3l . https://github.com/notifications/beacon/ABGF0ZA6Du82eQNCZrKF61ioSdtdPPzHks5taXRKgaJpZM4SYc3l.gif

@newgui I noticed that you're missing the following in DocumentsApi.csproj:

<RuntimeIdentifier>win7-x64</RuntimeIdentifier>

This line causes a Self-Contained Deployment to occur, which is necessary for this to work. This is something we have you do in the Prerequisites section of the doc. Let me know what happens after you add this and try again.

@scottaddie I just not got back to this and tried adding the win7-x64 configuration and republishing... However, I am still getting HTTP Error 502.5 - Process Failure.

@newgui

Here is a link to my project

I'm still out-of-town right now, but I'll be back home on Sunday. If @scottaddie is busy and can't get back to you by then, I'll try to help.

I don't use Dropbox, so can you put your project up in a GitHub repo for me to pull down? You can cut out all of the logic and just leave one API endpoint in it that returns a string or something.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

madelson picture madelson  Â·  3Comments

sonichanxiao picture sonichanxiao  Â·  3Comments

YeyoCoder picture YeyoCoder  Â·  3Comments

AnthonyMastrean picture AnthonyMastrean  Â·  3Comments

aaron-bozit picture aaron-bozit  Â·  3Comments