Skip to content

Converting a .csproj to .xproj RC2 #1451

Closed
@Bartmax

Description

@Bartmax

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions