dotnet-cli

'dotnet build' error after migrating dotnetcore project to 1.0.4

旧时模样 提交于 2019-12-06 03:52:43
I've been trying to run the dotnet build command on a migrated .net core project (from 1.0.0-preview2-003131 to 1.0.4). I followed the steps for migrating the project mentioned here , and the solution builds using Visual Studio 2017. However, using the dotnet CLI command 'dotnet build' gives me the following error: C:\Program Files\dotnet\sdk\1.0.4\Microsoft.Common.CurrentVersion.targets(2867,5): error MSB4216: Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "CLR4" and architecture "x86". Please ensure that (1) the requested

How to make ASP.NET Core RC2 app build on net46 framework with older third party dependencies

…衆ロ難τιáo~ 提交于 2019-12-06 00:46:09
I have a shiny new Asp.Net Core MVC App that references some older net45 libraries. Works fine with Asp.Net Core RC1 on full net45 framework. Migrating from Asp.NET Core rc1 to rc2 I have hit an obstacle that I don't know how to fix. The App is a ASP.NET Core App that using EF6, Autofac, Kendo.MVC and it needs to run on the full .Net 4.6 framework as there are references libraries that use WCF. In migrating from rc1 to rc2 I first update the NuGet.config feed to point to https://www.myget.org/F/aspnetcirelease/api/v3/index.json then I make the following changes to the project.json Remove

How do I build a native binary on .NET Core using the current preview?

本秂侑毒 提交于 2019-12-05 10:52:28
问题 Using the current .NET Core preview, how do I compile (Publish ?) a native binary for a console application. I am on Mac OS 10.11. I did the following: dotnet new dotnet restore dotnet publish I kind of expected "publish" to build a native binary for me, but it did not. It places a .dll, along with some JSON, in the publish folder ? I should mention the application runs fine when using dotnet run . So, how do I get a native binary for my simple console application ? 回答1: According to an MS

dotnet run web site with specific url

孤街浪徒 提交于 2019-12-05 07:19:06
How can I specify using dotnet cli to run my web app using specific configurations. I know hosting.json can be used but I did not find any documentation how to do this and how this relates to the dotnet cli. Look at this sample: https://github.com/aspnet/Security/blob/dev/samples/CookieSample/Program.cs#L11 Tweaked for command line: public static void Main(string[] args) { var config = new ConfigurationBuilder().AddCommandLine(args).Build(); var host = new WebHostBuilder() .UseKestrel() .UseConfiguration(config) .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup

How to open dotnet-core CLI project in Visual Studio 2017

别来无恙 提交于 2019-12-05 06:55:46
I have been developing a simple application using dotnet Core (for an API) and Angular2 for the purpose of learning both. I created the project using Yeoman on the command line and have been happily coding away in Visual Studio Code (on Windows). All seems to hang together well and it's been an enjoyable experience. I thought I might try out Visual Studio 2017 and see what the experience of developing a dotnet Core project in VS is like for a while. However, having installed VS2017 and cloned the project from github I am unsure how to proceed. I can't see any way to restore/build/run the

Updating Microsoft.NETCore.App to v1.1.0 causes -2147450749 (0x80008083)

孤街浪徒 提交于 2019-12-05 03:24:49
I created a new .NET Core project in Visual Studio 2015 by following the instructions at: https://www.microsoft.com/net/core#windowsvs2015 It works OK, and I can add breakpoints etc. no problem. Then I ran Tools->NuGet Package Manager->Manage NuGet Packages for Solution... I got the option to update Microsoft.NETCore.App to the latest stable release v1.1.0. The first issue I got was the error: Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. This appeared to be due to the update removing

Asp core wrong assembly redirect on publish

我的未来我决定 提交于 2019-12-05 02:31:54
When publishing my asp core project using visual studio a .config file is created alongside my executable. The .config includes a couple of bindingRedirect like this: <?xml version="1.0" encoding="utf-8"?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="6.0.0.0" newVersion="8.0.0.0" /> <bindingRedirect oldVersion="7.0.0.0" newVersion="8.0.0.0" /> <bindingRedirect oldVersion="6.0.0.0" newVersion="9.0.0.0" />

dotnet is not recognized as the name of a cmdlet

ぐ巨炮叔叔 提交于 2019-12-05 01:23:26
We have downloaded and run DotNetCore.1.0.1-SDK.1.0.0.Preview2-003133-x64.exe . After having closed and reopened our command prompt, running dotnet gives the following output. The term 'dotnet' is not recognized as the name of a cmdlet, function, script file, or operable program. We have tried the following: Uninstall all versions of Visual Studio. Uninstall all versions of .NET Core. Repair C++ Redistributable 2015 x86 & x64 Restart the computer. Then reinstall the .NET Core SDK. This is the contents of C:/Program Files/dotnet host fxr sdk 1.0.0-preview2-003133 shared Microsoft.NETCore.App

Excluding File From Publish Directory in VS 2017 .NET Core Project

Deadly 提交于 2019-12-04 02:14:17
I have a .gitignore file in the wwwroot folder of my project that I am trying to exclude from being published. The following code does not seem to work: <ItemGroup> <Content Include="wwwroot\.gitignore"> <CopyToPublishDirectory>Never</CopyToPublishDirectory> </Content> </ItemGroup> When I publish the project using the dotnet publish command, the .gitignore file is still found in the output directory. You have to use Update like so: <Content Update="wwwroot\.gitignore"> <CopyToPublishDirectory>Never</CopyToPublishDirectory> </Content> Replace your code <Content Include="wwwroot\.gitignore">

Convert a project.json to a csproj without using Visual Studio

让人想犯罪 __ 提交于 2019-12-03 23:25:04
As of preview3 dotnet new produces a csproj, and both dotnet restore and dotnet build fail against a project.json and/or an xproj. For instance, running dotnet restore against a directory that has both a project.json and an xproj gives this error. ...xproj(7,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0-preview3-004056\Extensions\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. Further, running it against a directory that has only a project.json gives