dotnet --info output:
.NET Command Line Tools (1.0.0-preview4-004233)
Product Information:
Version: 1.0.0-preview4-004233
Commit SHA-1 hash: 8cec61c6f7
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14986
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-preview4-004233
VS Code version:
Version 1.8.1
Commit ee428b0eead68bf0fb99ab5fdc4439be227b6281
Date 2016-12-19T14:49:23.350Z
Shell 1.4.6
Renderer 53.0.2785.143
Node 6.5.0
C# Extension version:
ms-vscode.csharp-1.6.0-beta6
Create .NET聽Core library project in Visual Studio 2017 RC
Add聽XUnit Unit Tests project.
Builds using MSBuild 15.0
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 20/12/2016 22:09:10.
Project "c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\StateMachineExplorations.sln" on node 1 (build target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Project "c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\StateMachineExplorations.sln" (1) is building "c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\src\StateMachineExplorations\StateMachineExplorations.csproj" (2) on node 1 (default targets).
c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\src\StateMachineExplorations\StateMachineExplorations.csproj(31,52): error MSB4066: The attribute "Version" in element <PackageReference> is unrecognized.
Done Building Project "c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\src\StateMachineExplorations\StateMachineExplorations.csproj" (default targets) -- FAILED.
Project "c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\StateMachineExplorations.sln" (1) is building "c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\tests\StateMachineExplorationTests\StateMachineExplorationTests.csproj" (3) on node 1 (default targets).
c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\tests\StateMachineExplorationTests\StateMachineExplorationTests.csproj(25,37): error MSB4066: The attribute "Version" in element <PackageReference> is unrecognized.
Done Building Project "c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\tests\StateMachineExplorationTests\StateMachineExplorationTests.csproj" (default targets) -- FAILED.
Done Building Project "c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\StateMachineExplorations.sln" (build target(s)) -- FAILED.
Build FAILED.
"c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\StateMachineExplorations.sln" (build target) (1) ->
"c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\src\StateMachineExplorations\StateMachineExplorations.csproj" (default target) (2) ->
c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\src\StateMachineExplorations\StateMachineExplorations.csproj(31,52): error MSB4066: The attribute "Version" in element <PackageReference> is unrecognized.
"c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\StateMachineExplorations.sln" (build target) (1) ->
"c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\tests\StateMachineExplorationTests\StateMachineExplorationTests.csproj" (default target) (3) ->
c:\Projects\PauloMorgado_GH\StateMachineExplorations\git\tests\StateMachineExplorationTests\StateMachineExplorationTests.csproj(25,37): error MSB4066: The attribute "Version" in element <PackageReference> is unrecognized.
0 Warning(s)
2 Error(s)
Time Elapsed 00:00:00.07
Paulo -- I'm a bit confused. VS Code doesn't launch MSBuild to build your project. Also, your repro steps don't actually get to the actual behavior (I assume you've opened the project and built somehow). Could you clarify your steps?
@DustinCampbell,
I created a solution on Visual Studio 2017 RC with聽a class library project and a聽XUnit unit test project.
Then I opened it in VSCode (after installing聽the latest聽beta of OmniSharp - 1.6.0-beta6).
Then I pressed Ctrl+Shift+B to build and it prompted me to configure the task runner and I chose MSBUILD.
The solution is here,聽if you want to take a look at it.
Ah. The problem is choosing MSBuild. That's not actually owned by the C# extension. Try this:
Doh!
Now it builds using Microsoft (R) Build Engine version 15.1.458.808.
Can I聽run the unit tests in聽VSCode?
Not really. We don't have very robust support for unit testing in VS Code. There's some support, but it's not great. You should be able to run unit tests at the command line with dotnet test.
Yep! Working fine on the command line.
Strange that the test project builds聽fine, but on the editor it's complaining about Moq.

Maybe run dotnet restore at the command line?
That was聽my first thought.
Eventually closing and opening VSCode solved it.
Ahh... it's likely that you had VS Code open with your project when you performed a dotnet restore. In that case, OmniSharp wouldn't have caught the change yet. You can kick OmniSharp with the Restart OmniSharp command inside VS Code (or close/open your project, or just restart).
csproj-based .NET Core projects are still a work-in-progress. :smile:
Paulo, I'm going to close this for now because the original issue sounds like it's solved. Feel free to file issues if you come across problems. We're definitely interested in whatever can help make the extension better. Thanks!
Hi, I m using Jenkins to build my project but m getting the following error
`Build started 3/27/2018 2:30:27 PM.
Project "D:\PSAVWorkSpaces\abcd\Dev\ReleaseA\abcd\abcd\abcd.Droid\abcd.Droid.csproj" on node 1 (SignForAndroid target(s)).
D:\PSAVWorkSpaces\abcd\Dev\ReleaseA\abcd\abcd\abcd.Droid\abcd.Droid.csproj(113,47): error MSB4066: The attribute "Version" in element is unrecognized.
Done Building Project "D:\PSAVWorkSpaces\abcd\Dev\ReleaseA\abcd\abcd\abcd.Droid\abcd.Droid.csproj" (SignForAndroid target(s)) -- FAILED.
Build FAILED.
"D:\WorkSpaces\abcd\abcd\abcd.Droid\abcd.Droid.csproj" (SignForAndroid target) (1) ->
D:\WorkSpaces\abcd\abcd\abcd.Droid\abcd.Droid.csprojj(113,47): error MSB4066: The attribute "Version" in element is unrecognized.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.01
Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure
Finished: FAILURE`
i tried using dotnet restore but it pop up with below error
D:\Jenkins\JenkinsHome\workspace\abcd>dotnet restore D:\Jenkins\JenkinsHome\workspace\abcd\abcd.Common.Files\abcd.Common.Files.csproj(158,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.100\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. D:\Jenkins\JenkinsHome\workspace\abcd\abcd.Sqlite.Entities\abcd.Sqlite.Entities.csproj(71,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.100\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. D:\Jenkins\JenkinsHome\workspace\abcd\abcd.Generic.Interfaces\abcd.Generic.Interfaces.csproj(64,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.100\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. D:\Jenkins\JenkinsHome\workspace\abcd\abcd.WebApi.Interfaces\abcd.WebApi.Interfaces.csproj(71,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.100\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. D:\Jenkins\JenkinsHome\workspace\abcd\abcd.Sqlite.Interfaces\abcd.Sqlite.Interfaces.csproj(76,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.100\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. D:\Jenkins\JenkinsHome\workspace\abcd\abcd\abcd.Droid\abcd.Droid.csproj(269,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.100\Xamarin\Android\Xamarin.Android.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. D:\Jenkins\JenkinsHome\workspace\abcd\abcd.WebApi.Methods\abcd.WebApi.Methods.csproj(98,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.100\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. Files\dotnet\sdk\2.1.100\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on di
can anyone help me with this
thankyou
@SonaliRane26: This is the repo for the C# extension for VS Code. We can only help you here with issues related to that project.
I suspect you're looking for https://github.com/dotnet/cli or https://github.com/dotnet/sdk. However, I can tell you that you will not be able to build Xamarin or Portable projects with the .NET CLI, which it looks like you're trying to do.
Yes, thankyou
Most helpful comment
Paulo, I'm going to close this for now because the original issue sounds like it's solved. Feel free to file issues if you come across problems. We're definitely interested in whatever can help make the extension better. Thanks!