dotnet new
npm init
npm install protractor --saveDev
dotnet build
no errors
<projectname>/node_modules/protractor/node_modules/selenium-webdriver/lib/test/data/Page.aspx.cs(4,36): error CS0234: The type or namespace name 'Web' does not exist in the namespace 'System' (are you missing an assembly reference?)
dotnet --info
.NET Command Line Tools (1.0.0-beta-002202)
Product Information:
Version: 1.0.0-beta-002202
Commit Sha: 60b23d5115
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.11
OS Platform: Darwin
RID: osx.10.11-x64
set the compileExclude in project.json
"compileExclude": "node_modules"
compileExclude is deprecated now, use "compile": { "exclude": "node_modules/" } in buildOptions
I just tried this in preview3 with csproj and it worked quite nicely :) Here is the csproj I used, for reference. Notice the <Compile ... Exclude="..."/>
tag.
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs"
Exclude="node_modules/selenium-webdriver/**/*.cs" />
<EmbeddedResource Include="**\*.resx" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App">
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161104-2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
I found the problem and the solution. I had angular2 cli project in this folder
i have excluded that folder and now build works.
"compile": {
"exclude": ["angular2cli-project"]
}
Most helpful comment
compileExclude is deprecated now, use "compile": { "exclude": "node_modules/" } in buildOptions