project.json

Unable to build default ASP.Net Core Web Application (.NET Core) on Visual Studio Team Services using Hosted Agent

有些话、适合烂在心里 提交于 2019-12-22 03:48:09
问题 Having created a new ASP.Net Core Web Application (.Net Core) project in Visual Studio 2015 Update 3 and checked this in to a Visual Studio Team Services git repository. I am using the release version of .Net Core and ASP.Net Core. I am now trying to build this using the VSTS Build system using a build definition based on this guide: https://www.visualstudio.com/en-us/docs/build/apps/aspnet/aspnetcore-to-azure However, the build fails on the dotnet restore step with the log shown below (first

project.json Equivalent of InternalsVisibleTo

假装没事ソ 提交于 2019-12-21 07:26:08
问题 .Net Core's project.json allows configuration of various assembly properties (e.g. title, version, copyright) that a traditional .Net application would define using attributes typically placed in AssemblyInfo.cs (e.g. AssemblyTitle, AssemblyCopyright, AssemblyVersion). However, one assembly property I haven't figured out how to set in project.json is InternalsVisibleTo. Is there a way to use project.json to indicate that another assembly should have internal visibility into the current

project.json Equivalent of InternalsVisibleTo

倖福魔咒の 提交于 2019-12-21 07:26:05
问题 .Net Core's project.json allows configuration of various assembly properties (e.g. title, version, copyright) that a traditional .Net application would define using attributes typically placed in AssemblyInfo.cs (e.g. AssemblyTitle, AssemblyCopyright, AssemblyVersion). However, one assembly property I haven't figured out how to set in project.json is InternalsVisibleTo. Is there a way to use project.json to indicate that another assembly should have internal visibility into the current

Automating Nuget Package Push With .NetCore RC2

浪尽此生 提交于 2019-12-21 05:41:20
问题 I am currently working on a .NET Core library that I am going to use as a NuGet package in another project. I have been able to successfully package the project using the "dotnet pack" command in the project directory, and upload that package to MyGet. I would prefer to automate this process of pushing the NuGet package by using the "nuget push" command. My issue is that the "scripts" property defined in the project.json file does not seem to be executed on pack or build. I expected that

dnu publish - System.ArgumentNullException: Value cannot be null

倖福魔咒の 提交于 2019-12-20 05:57:36
问题 When running the following dnu publish , I get an ArgumentNullException exception thrown. dnu publish "C:\Project\MyProject" --out "C:\a" --configuration Debug --runtime dnx-clr-win-x86.1.0.0-beta6 Exception thrown: Restoring packages for C:\a\approot\src\RelatedProject\project.json ---------- System.ArgumentNullException: Value cannot be null. Parameter name: key at System.Collections.Generic.Dictionary`2.FindEntry(TKey key) at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key,

“The library 'hostpolicy.dll' required” if run from deploy folder, but emitEntryPoint is true

梦想与她 提交于 2019-12-19 07:48:47
问题 I created a Web API project using the default ASP.NET Core Web Application (.NET Framework) template and then published to local folder using VS. Now if I call dotnet application.exe in the console, I receive the following error: A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found I have found in this answer and this issue on github, that the actual problem is a missing emitEntryPoint property. All is fine, except that my project.json

Design-time T4 templates in ASP.NET 5 (VS 2015)

家住魔仙堡 提交于 2019-12-19 03:46:12
问题 I can't seem to find a way to make T4 templates in VS 2015 RTM, in an ASP.NET 5 (vNext) project. I even installed the T4 toolbox for Visual Studio 2015 extension, but the tt templates are not transformed. The property Custom Tool doesn't appear in the tt file properties, neither can't I find the ' Run Custom Tool ' command. Update The reason I want the T4 templates, is the introduction of the config.json file, and the pluggable configuration system, which is an awesome thing, but with the

using moq with asp.net core while unit testing

两盒软妹~` 提交于 2019-12-14 02:23:45
问题 I am trying to write a very simple unit test in asp.net core using moq and xunit. But I am getting a error when I run the unit test. StackTrace: at Moq.Mock 1..ctor(MockBehavior behavior, Object[] args) at Moq.Mock 1..ctor(MockBehavior behavior) at Moq.Mock`1..ctor() Could not load file or assembly 'System.Core, version=4.0.0'. Below is my code and project.json file. { "version": "0.1.0-*", "testRunner": "xunit", "dependencies": { "Moq": "4.5.22", "xunit": "2.2.0-beta2-build3300", "dotnet

Using .NET Core library in .NET 4.5.2 console application

假装没事ソ 提交于 2019-12-12 11:33:26
问题 I have two projects: one project is built on .NET Core and the other one is built on normal .NET Framework 4.5.2. I want to know how I can use my .NET Core cass library in my .NET Console Application. Here is my project.json: { "version": "1.0.0-*", "dependencies": { "NETStandard.Library": "1.6.0", "NLog.Web.AspNetCore": "4.3.0", "System.Xml.XmlSerializer": "4.0.11" }, "frameworks": { "netstandard1.6": { "imports": "dnxcore50" }, "net452": {} } } I tried to include the project as a normal

Can two project.json files share the same codebase?

眉间皱痕 提交于 2019-12-11 04:36:36
问题 I have some codebase from which I want to build a .NET Core library and a UWP library. Initially, I wanted to build a single lib which would serve for both but I didn't find a way for this (in UWP case, the lib needs to reference UWP specific classes like StreamSocket). So I created a separate project file for UWP. However, looks like I can't create a separate project.json (I can't have core.json and uwp.json because project.json name is constant). And I don't want to create multiple copies