pavikirthi
pavikirthi

Reputation: 1655

Run Microsoft Visual Studio C# project in Linux

I downloaded a c# .net project from git onto ubuntu and installed .net libraries from http://www.mono-project.com/download/#download-lin and also donet core from https://www.microsoft.com/net/core#linuxubuntu.

when I run donet restore, I am getting the following error

/home/ubuntu/DotNetWallet/src/DotNetWallet/DotNetWallet.xproj(8,3): error MSB4019: The imported project "/usr/share/dotnet/sdk/1.0.3/Microsoft/VisualStudio/v14.0/DotNet/Microsoft.DotNet.Props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I guess the problem is with the DotNetWallet.xproj which generally is compatible with visual studio but how can I run it on ubuntu?

So, I used 'dotnet migrate' ,and then used 'donet restore', it now works fine, but when I run 'donet build', I am getting the following error

FakeData.cs(1,20): error CS0234: The type or namespace name 'KeyManagement' does not exist in the namespace 'DotNetWallet' (are you missing an assembly reference?) [/home/ubuntu/DotNetWallet/src/DotNetWallet/DotNetWallet.csproj]

And, here is the git repo link https://github.com/nopara73/DotNetWallet

Upvotes: 2

Views: 4674

Answers (1)

Kalten
Kalten

Reputation: 4312

Many step are required in order to run this project.

First delete global.json file and then run dotnet migrate and remove the backup directory.

(Optional) In some case you will need to clean the solution. If DotNetWallet.xproj and project.json are still there, remove it and run the twxo following command.

  • dotnet sln remove src/DotNetWallet/DotNetWallet.xsproj
  • dotnet sln add src/DotNetWallet/DotNetWallet.csproj

Then, remove the first line (using DotNetWallet.KeyManagement;) from FakeData.cs file. This is an unused using statment. there are no impact to remove it.

Now, you can run dotnet restore, dotnet build then dotnet test.

Upvotes: 1

Related Questions