Skip to content
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

Tool runs on .net framework projects #5

Open
PhilPJL opened this issue Oct 13, 2017 · 8 comments
Open

Tool runs on .net framework projects #5

PhilPJL opened this issue Oct 13, 2017 · 8 comments

Comments

@PhilPJL
Copy link

PhilPJL commented Oct 13, 2017

Installed product versions

  • Visual Studio: 2017 (15.5.0)

Description

This page https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files
says

Important
At present, package references are supported in Visual Studio 2017 only, for .NET Core projects, .NET Standard projects, and UWP projects targeting Windows 10 Build 15063 (Creators Update).

Yet I can run it on any project type.

@robertmclaws
Copy link
Contributor

I think this documentation is incorrect, as I have it installed on .NET Framework projects with no problem. @davkean, those references can work anywhere in VS2017, right?

@PhilPJL
Copy link
Author

PhilPJL commented Oct 13, 2017

I'm thinking the documentation is correct. I ran your tool on a .net framework web app. It now fails to build

image

I'm assuming this looks correct

image

@robertmclaws
Copy link
Contributor

I'm using it on a .NET Framework-based Web Project, and it's totally fine. You appear to be missing a reference to System.Web.Http. You might need to re-add the Assembly Reference to System.Web.Http from the "Add Reference" dialog. (I don't believe there is a NuGet package for that one.)

@PhilPJL
Copy link
Author

PhilPJL commented Oct 15, 2017

Robert, I got a test scenario to work, but there may be an issue or two for you to fix. Try this:

  1. create a new MVC web app
  2. updated all NuGet packages (packages.config)
  3. changed tools/options/nugget package manager to use packagereference

image

  1. run your upgrader

  2. close vs/open vs/build clean

  3. do a build - which fails

  4. Downgrade one Nuget package and update it again. All of the package references now appear in solution explorer. Build succeeds.

I tried the scenario again. This time I left one package that needed to be updated before I ran your upgrader. The references in solution explorer at this point are not package references (they aren't the little blue icon). Update the remaining Nuget package and they all change. Builds ok.

@robertmclaws
Copy link
Contributor

Can you please tell me the options you selected for creating a new MVC app? .NET Framework or Core? Which version?

Also, I would assume "allow format selection" is what is blocking you... if you uncheck that, I would assume it would use PackageReference and not give you a choice as those packages are restored. But that could be a VS bug.

Finally, you shouldn't need to close and restart VS in order for my tool to work. It should prompt you to reload the solution, at which point you should rebuild and be fine.

Thanks!

@PhilPJL
Copy link
Author

PhilPJL commented Oct 15, 2017

Using VS 2017 15.4.0
Create new 'ASP.NET Web Application (.NET Framework)' .NET 4.7
MVC, No authentication, No unit tests.

@PhilPJL
Copy link
Author

PhilPJL commented Oct 15, 2017

Tried unchecking 'allow format selection'. No difference.

@robertmclaws
Copy link
Contributor

I'm on the 14.5 preview and I could not reproduce. My defaults were already set to PackageReference.

I would say this. Why download package updates before upgrading? Create the new project, upgrade the PackageReferences, THEN build. Even if VS has a bug with the PackageReferences with the first load, you're off package.config right away, the packages aren't downloaded yet, and they'll install when you build the first time. Then update after that.

I'm not sure if I can do anything about this, because I'm not sure it's a problem in my upgrader. I will keep an eye on reports though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants