dnx

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,

Where did Attribute.IsDefined go in DNX Core 5.0?

 ̄綄美尐妖づ 提交于 2019-12-19 16:33:26
问题 I'm trying to check if a property has an attribute. This used to be done with: Attribute.IsDefined(propertyInfo, typeof(AttributeClass)); However I get a warning that it's not available in DNX Core 5.0 (it still is in DNX 4.5.1). Has it not been implemented yet or has it moved like other type/reflection related stuff? I'm using beta7. 回答1: Edit: There actually seems to be an IsDefined extension method in the System.Reflection.Extensions package. Usage: var defined = propertyInfo.IsDefined

Where did Attribute.IsDefined go in DNX Core 5.0?

主宰稳场 提交于 2019-12-19 16:33:18
问题 I'm trying to check if a property has an attribute. This used to be done with: Attribute.IsDefined(propertyInfo, typeof(AttributeClass)); However I get a warning that it's not available in DNX Core 5.0 (it still is in DNX 4.5.1). Has it not been implemented yet or has it moved like other type/reflection related stuff? I'm using beta7. 回答1: Edit: There actually seems to be an IsDefined extension method in the System.Reflection.Extensions package. Usage: var defined = propertyInfo.IsDefined

The navigation on entity type has not been added to the model, or ignored, or entityType ignored

↘锁芯ラ 提交于 2019-12-18 06:08:56
问题 The navigation 'Tags' on entity type 'Notepad.Models.Note' has not been added to the model, or ignored, or entityType ignored. public class Note { public Note() { CreationDate = DateTime.Now; Tags = new HashSet<Tag>(); Parts = new HashSet<Part>(); } public int ID { get; set; } public virtual ICollection<Tag> Tags { get; set; } public virtual ICollection<Part> Parts { get; set; } public DateTime? CreationDate { get; set; } } public class Tag { public Tag() { Notes = new HashSet<Note>(); }

Show ASP.NET 5 error page in Azure web app

时光毁灭记忆、已成空白 提交于 2019-12-17 22:58:35
问题 I am getting a 500 Internal Server Error when deploying our ASP.NET 5 web application to an Azure Web App. How do I get the details and stacktrace for this exception? I have done the following but with no luck: Using the diagnostics error page on startup: app.UseErrorPage(); Setting ASPNET_ENV in Azure portal: Using DNX beta 6. 回答1: In case this helps someone, I've found out that if you're using ASP.NET RC1 and you're using Azure WebApps and add an App setting called Hosting:Environment with

RealProxy in dotnet core?

岁酱吖の 提交于 2019-12-17 22:27:10
问题 I'm working with the namespaces System.Runtime.Remoting.Proxies and System.Runtime.Remoting.Messaging for AOP in C#. I'm trying to port my application from .Net Framework 4.6 to dnxcore/dotnet core. Intellisense says, that these two namespaces are not available with my framework-vesion (netcoreapp1.0 / dnxcore50). Any idea if these two namespaces will appear? or any idea how to get the AOP like with the RealProxy -class? I don't want to use 3rd-party-libraries - I only want to use what .Net

HttpClient in ASP.NET 5.0 not found?

∥☆過路亽.° 提交于 2019-12-17 20:02:27
问题 Using VS2015 and asp.net 5, when I try to compile my site using an instance of System.Net.HttpClient, it tells me: The type or namespace name 'HttpClient' could not be found (are you missing a using directive or an assembly reference?) Hovering over the offending code, I see: "WebApplication1.ASP.NET 5.0 - Available" "WebApplication1.ASP.NET Core 5.0 - Not Available" I have 2 frameworks listed in my project.json file: "frameworks": { "aspnet50": { }, "aspnetcore50": { } }, I'm assuming that

How to fix DNX/DNVM in Visual Studio 2015?

假装没事ソ 提交于 2019-12-17 09:15:10
问题 Today I installed VS 2015 on Windows 7 x64. Mainly to test new .Net Core features and etc. And for test I created new C# "Console Application (Package)" solution and got this message: DNX SDK version 'dnx-clr-win-x86.1.0.0-beta5' failed to install. The solution will use DNX SDK version ‘dnx-clr-win-x86.1.0.0-beta5’ for this session. I can't compile and debug project. Also, when I have opened debug tab in project properties then VS crashed. DNVM output when I opened solution: Invoke-Command :

Runtime services no longer get injected into DNX console app (RC1)

自闭症网瘾萝莉.ら 提交于 2019-12-13 14:27:49
问题 I used to be able to inject runtime services like IApplicationEnvironment into the constructor of the Pogram class of a DNX console application. However, using the latest CI build of RC1, the services no longer get injected: public Program(IApplicationEnvironment env) { if (env == null) { // env is null. throw new ArgumentNullException(nameof(env)); } } 回答1: The DNX platform wants to be compatible with regular Program.Main entry points. Therefore they removed dependency injection into the

NuGet not working properly with Asp5-Mvc6

可紊 提交于 2019-12-13 07:37:18
问题 When restoring packages in the new xproj project types, there are the new package config in the project.json : "dependencies": { "Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final", "Microsoft.AspNet.Authentication.Facebook": "1.0.0-rc1-final", "Microsoft.AspNet.Authentication.Google": "1.0.0-rc1-final", .... } Nuget restores theese with no problem. When the .xproj depends on normal .proj files, you sometimes needs to create wrappers, and write the dependency like this: "frameworks":