project.json

Solving error “Microsoft.NETCore.App 1.0.0 does not support framework .NETFramework,Version=v4.6.1”

被刻印的时光 ゝ 提交于 2019-11-30 11:43:45
I have an ASP.NET Core 1.0 complete application running using net461 references. Now I am trying to add another framework - netcoreapp1.0 . For this, I have updated my project.json like this: { "userSecretsId":"", "version":"2.4.0-*", "buildOptions":{ "emitEntryPoint":true, "preserveCompilationContext":true }, "dependencies":{ "Microsoft.ApplicationInsights.AspNetCore":"1.0.0", "Microsoft.AspNetCore.Authentication.Cookies":"1.0.0", "Microsoft.AspNetCore.Diagnostics":"1.0.0", "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore":"1.0.0", "Microsoft.AspNetCore.Identity":"1.0.0", "Microsoft

Unit testing a .NET Standard 1.6 library

Deadly 提交于 2019-11-30 11:17:53
I am having trouble finding up to date documentation on how to unit test a .NET Standard 1.6 class library (which can be referenced from a .NET Core project). Here is what my project.json looks like for my library: { "supports": {}, "dependencies": { "Microsoft.NETCore.Portable.Compatibility": "1.0.1", "NETStandard.Library": "1.6.0", "Portable.BouncyCastle": "1.8.1.2" }, "frameworks": { "netstandard1.6": {} } } Now the left over task is to be able to create some sort of a project that can do the unit testing. The goal is to use xUnit since it seems that this is what the .NET Core team is

Solving error “Microsoft.NETCore.App 1.0.0 does not support framework .NETFramework,Version=v4.6.1”

北城余情 提交于 2019-11-29 17:19:47
问题 I have an ASP.NET Core 1.0 complete application running using net461 references. Now I am trying to add another framework - netcoreapp1.0 . For this, I have updated my project.json like this: { "userSecretsId":"", "version":"2.4.0-*", "buildOptions":{ "emitEntryPoint":true, "preserveCompilationContext":true }, "dependencies":{ "Microsoft.ApplicationInsights.AspNetCore":"1.0.0", "Microsoft.AspNetCore.Authentication.Cookies":"1.0.0", "Microsoft.AspNetCore.Diagnostics":"1.0.0", "Microsoft

Unit testing a .NET Standard 1.6 library

混江龙づ霸主 提交于 2019-11-29 16:58:10
问题 I am having trouble finding up to date documentation on how to unit test a .NET Standard 1.6 class library (which can be referenced from a .NET Core project). Here is what my project.json looks like for my library: { "supports": {}, "dependencies": { "Microsoft.NETCore.Portable.Compatibility": "1.0.1", "NETStandard.Library": "1.6.0", "Portable.BouncyCastle": "1.8.1.2" }, "frameworks": { "netstandard1.6": {} } } Now the left over task is to be able to create some sort of a project that can do

ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json

天大地大妈咪最大 提交于 2019-11-29 09:09:09
I want to simplify my configuration in my ASP.NET Core Web Application (.NET Framework) application using VS 2017. I already know that my website will be running under Windows/IIS in x64 environment and .NET 4.6.2. There is no chance in the foreseen and unforeseen future for this application to use any other environment from the dev to production. So, I only need Debug x64 and Release x64 modes only. (AnyCPU and x86 are not needed!), so I went ahead and removed all other configuration from the project. Now, upon compilation, I am getting the following error: 'C:\Projects\MyProject\My.Website

How to run scripts based on solution configuration in ASP.NET Core

。_饼干妹妹 提交于 2019-11-29 05:45:44
I have the following script in my project.json file which I am using to build my class library project into a NuGet package. I don't want to build any Debug NuGet packages. How can I limit this script to only run when the solution configuration is set to Release mode to speed up the build time in debug mode? Alternatively, as a matter of curiosity, how can I pass the solution configuration into the command below so that 'Release' is not hard coded. "scripts": { "postcompile": [ "dotnet pack --no-build --configuration Release" ] } You can use %compile:Configuration% to get the current

How to use System.Windows.Forms in .NET Core class library

僤鯓⒐⒋嵵緔 提交于 2019-11-28 12:10:52
I've created .NET Core class library and try to build it against net40 framework. I want to use Clipboard class from System.Windows.Forms assembly. How can I do this? My project.json file: { "version": "1.0.0-*", "dependencies": { "NETStandard.Library": "1.6.0" }, "frameworks": { "netstandard1.6": { "imports": "dnxcore50", "buildOptions": { "define": [ "NETCORE" ] }, "dependencies": { "System.Threading": "4.0.11", "System.Threading.Thread": "4.0.0", "System.Threading.Tasks": "4.0.11" } }, "net40": { "buildOptions": { "define": [ "NET40" ] }, "dependencies": { // dependency should be here but

What does compilationOptions.emitEntryPoint mean?

随声附和 提交于 2019-11-28 11:53:27
Just installed the rc1 tools and created a new web project to see what has changed in the template. I noticed that project.json now contains: "compilationOptions": { "emitEntryPoint": true } But it's unclear what this does. Does anyone have an idea? As mentioned below: It looks like it is a flag to the compiler to indicate that the project is a console application vs. a library (namely: a console application must contain public static void Main() ) You can see from the source here. In the new RC1 default web application template, you'll notice at the bottom of Startup.cs there is a new

ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json

人盡茶涼 提交于 2019-11-28 02:29:19
问题 I want to simplify my configuration in my ASP.NET Core Web Application (.NET Framework) application using VS 2017. I already know that my website will be running under Windows/IIS in x64 environment and .NET 4.6.2. There is no chance in the foreseen and unforeseen future for this application to use any other environment from the dev to production. So, I only need Debug x64 and Release x64 modes only. (AnyCPU and x86 are not needed!), so I went ahead and removed all other configuration from

How to run scripts based on solution configuration in ASP.NET Core

ぐ巨炮叔叔 提交于 2019-11-27 23:21:14
问题 I have the following script in my project.json file which I am using to build my class library project into a NuGet package. I don't want to build any Debug NuGet packages. How can I limit this script to only run when the solution configuration is set to Release mode to speed up the build time in debug mode? Alternatively, as a matter of curiosity, how can I pass the solution configuration into the command below so that 'Release' is not hard coded. "scripts": { "postcompile": [ "dotnet pack -