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

Converting a .csproj to .xproj RC2 #1451

Closed
Bartmax opened this issue May 17, 2016 · 4 comments
Closed

Converting a .csproj to .xproj RC2 #1451

Bartmax opened this issue May 17, 2016 · 4 comments

Comments

@Bartmax
Copy link
Contributor

Bartmax commented May 17, 2016

This steps will get you on the success path of migrating a csproj to xproj using framework net451.

1 Delete csproj file.
2 rename package.config to project.json
3 edit project.json as follows:

Imagine you have this content:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net451" />
  <package id="SomeCoolPackage" version="3.0.1" targetFramework="net451" />
</packages>

Update it so it became:

{
  "dependencies": {
    "SomeCoolPackage": "3.0.1",
    "Newtonsoft.Json": "8.0.3"
  },
  "frameworks": {
    "net45": {
    }
  },
  "runtimes": {
    "win": { }
  }
}
  • run dotnet restore
  • run dotnet build

You may find some errors, for example missing some framework assemblies.

Take note of which assemblies are missing and add them as follows:


{
  "dependencies": {
    "SomeCoolPackage": "3.0.1",
    "Newtonsoft.Json": "8.0.3"
  },
  "frameworks": {
 "net45": {
      "frameworkAssemblies": {
        "System.Runtime.Serialization": "4.0.0.0",
      }
    }
  },
  "runtimes": {
    "win": { }
  }
}

DONE. ;) Enjoy the new world.

@niemyjski
Copy link

This was really helpful

@mikeparker
Copy link

mikeparker commented Jun 10, 2016

Unless i'm missing something, this doesn't create a .xproj file?

In order to create the xproj: Start visual studio and add existing project - select the project.json file. This will create the xproj.

@peter-orange
Copy link

Life saver. Thank you.

@aspnet-hello
Copy link

This issue is being closed because it has not been updated in 3 months.

We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants