project.json

Is there an alternative to contentFiles with projects that use packages.config?

夙愿已清 提交于 2021-02-04 19:51:05
问题 I have a nuget package with content that I want to be copied to the build output when users install my package. There is support for this: NuGet ContentFiles Demystified in NuGet v3.3. However, it only works in projects that use project.json . The contentFiles are not copied to my build output when I have a project that uses packages.config . Is there an alternative or workaround I could use in order to make my NuGet package work on projects that use either a project.json or packages.config ?

How to reference a specific version of NetStandard in project.json?

岁酱吖の 提交于 2020-01-07 03:44:28
问题 I am struggling to figure out how to force the npm ( Nuget Package Manager ) to resolve a specific version of the NetStandard1.X platform. I am trying to use Serilog but the version of .NetStandard it supports is v1.3. Is there any way to force this behavior in the project.json file via some command or switch or option. { "version": "1.0.0-*", "dependencies": { "NETStandard.Library": "1.6.0", "Serilog": "2.2.1" }, "frameworks": { "netstandard1.3": { "imports": "dnxcore50", "dependencies": { }

Reference a class library from UWP and ASP.NET 5

坚强是说给别人听的谎言 提交于 2020-01-02 01:20:07
问题 I am trying to create a class library that'll contain common objects (mainly DTOs) of a WebAPI (using ASP.NET 5) and a consuming UWP App. However, I have not yet figured out how to create the class library such that it can be referenced from both other projects. What I have tried so far: First, I tried a Class Library (Package) , which can be found under Web . This type of library can be referenced from the ASP.NET project without problems, but when trying to reference it from the UWP project

EF 6 with a dnx project

允我心安 提交于 2019-12-30 17:27:24
问题 I have a new ASP.net 5 dnx class library I am using for entity framework. I need to target EF 6 because some features I need are not in EF 7. First the EF tools (like enable-migration) were not there. I added an old style class library and installed EF 6 and now the commands are there. When I run enable migrations I get this error: PM> Enable-Migrations Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject'

EF 6 with a dnx project

。_饼干妹妹 提交于 2019-12-30 17:27:08
问题 I have a new ASP.net 5 dnx class library I am using for entity framework. I need to target EF 6 because some features I need are not in EF 7. First the EF tools (like enable-migration) were not there. I added an old style class library and installed EF 6 and now the commands are there. When I run enable migrations I get this error: PM> Enable-Migrations Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject'

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

拟墨画扇 提交于 2019-12-28 06:32:08
问题 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" } },

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

♀尐吖头ヾ 提交于 2019-12-28 06:32:05
问题 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" } },

Is project.json deprecated?

≯℡__Kan透↙ 提交于 2019-12-28 04:01:34
问题 Is project.json going away and web.config coming back in ASP.NET Core 1.0? In the roadmap document, the update in '16 Q4 or '17 Q1, they mention "replacing .xproj/project.json with .csproj/MSBuild". Does that mark the end of project.json? 回答1: Update : As of Visual Studio 2017 and the latest dotnet CLI, project.json is officially dead. Visual Studio will migrate projects automatically, and there is a comparison chart here: https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project

Why can't I use embedded resources (resx) when targeting .netstandard 1.3?

偶尔善良 提交于 2019-12-22 05:14:12
问题 (Question subtitle: Are resources not supported in .netstandard 1.3 or is my project file just messed up?) I just created an example portable class library in Visual Studio 2015 Update 3 and added a sample resource file. Initially, the file project.json looks like this: { "supports": { "net46.app": {}, "uwp.10.0.app": {}, "dnxcore50.app": {} }, "dependencies": { "Microsoft.NETCore": "5.0.0", "Microsoft.NETCore.Portable.Compatibility": "1.0.0" }, "frameworks": { "dotnet": { "imports":

Why can't I use embedded resources (resx) when targeting .netstandard 1.3?

大兔子大兔子 提交于 2019-12-22 05:14:06
问题 (Question subtitle: Are resources not supported in .netstandard 1.3 or is my project file just messed up?) I just created an example portable class library in Visual Studio 2015 Update 3 and added a sample resource file. Initially, the file project.json looks like this: { "supports": { "net46.app": {}, "uwp.10.0.app": {}, "dnxcore50.app": {} }, "dependencies": { "Microsoft.NETCore": "5.0.0", "Microsoft.NETCore.Portable.Compatibility": "1.0.0" }, "frameworks": { "dotnet": { "imports":