.net-4.5

Add a reference to the System.IdentityModel.Tokens DLL

淺唱寂寞╮ 提交于 2019-12-23 13:22:47
问题 How do I add a reference to the System.IdentityModel.Tokens dll? It does not seem to come up in the Nuget Package Manager. Do I need to download the DLL? I have .Net 4.5 installed. The following code will not compile without the reference: SessionSecurityToken sst = e.SessionToken; 回答1: It does exist on NuGet, and was last published 2013-02-08, so I don't understand why you couldn't find it. Try searching for System.IdentityModel.Tokens.ValidatingIssuerNameRegistry . The best way is to

How do I make non-essential computations run in the background?

为君一笑 提交于 2019-12-23 12:41:04
问题 This question is in follow up to Why is this code running synchronously? . I realize that my real question is at a higher level than the one in that post. The question I now ask, below, is "how do I accomplish this?" I want to use concurrency in C# to compute things in the background. I have class ptsTin, which represents an existing ground surface. I want to make loading as fast as possible. Some of the work is essential in that you don't have an instance until the work is complete. For

ClickOnce won't install .NET 4.5

狂风中的少年 提交于 2019-12-23 07:56:15
问题 I’m trying to deploy a WPF application using ClickOnce. The project’s target framework is: “.NET Framework 4.5”. In the VS project properties -> “Publish” -> “Prerequisites” I have checked two items: “Microsoft .NET Framework 4.5 (x86 and x64)” “Windows Installer 4.5” When I try to launch this application on a Windows 7 computer that doesn’t have .NET 4.5 preinstalled I get a popup saying: The installation does not attempt to download/install the framework for me. It simply gives up

ServiceStack Ormlite: System.InvalidProgramException JIT Compiler encountered an internal limitation

守給你的承諾、 提交于 2019-12-23 07:47:31
问题 Hi i'm running ServiceStack with Ormlite and I encountered this error. Previously it is working fine. I'm not sure what I have changed that caused this error. I just used a simple db.Select() call and it throws this error. I tried various ways, like updating the nuget packages, clean and rebuild the project, etc and none of them works. System.InvalidProgramException was caught _HResult=-2146233030 _message=JIT Compiler encountered an internal limitation. HResult=-2146233030 IsTransient=false

Why isn’t ReadOnlyDictionary thread-safe?

自古美人都是妖i 提交于 2019-12-23 07:19:26
问题 I’m looking for a readonly-dictionary to be accessed from multiple threads. While ConcurrentDictionary exposes such capabilities, I don’t want to have the overhead and the strange API. .Net 4.5 while providing such a class, the documentation states that only static calls are safe. I wonder why? 回答1: ReadOnlyDictionary is just a wrapper around any other dictionary. As such, it's only as thread-safe as the underlying dictionary. In particular, if there's a thread modifying the underlying

.net 4.5 Asp Mvc -> Error 403.14- IIS 7 - Windows Server 2008 R2

妖精的绣舞 提交于 2019-12-23 07:02:24
问题 When I want to deploy an MVC 4 (.net 4.5) application to my iis i got the 403.14 calling me that the content ist not browseable. This also occurs when i deploy the unchanged mvc 4 template. when using the mvc 4 template with .net 4.0 everything works. I checked the other posts but can't figure out the solution. ist set i ran aspnet_regiss -i which completed without any errors. the only strange thing is that .net 4.5 is installed in the .net 4.0 directory %windows%/microsoft.net/Framework64/ 4

Entity Framework entity is not in DataSpace.OSpace (_workspace.GetItemCollection(DataSpace.OSpace)) but is in DataSpace.CSpace

浪尽此生 提交于 2019-12-23 06:58:10
问题 I have been mucking around with XML s for entity Framework. I tried to create a type of entity that could have properties injected at runtime, First I created DynamicEntity object that is dynamic public class DynamicEntity : DynamicObject { Dictionary<string, object> dynamicMembers = new Dictionary<string, object>(); public override bool TrySetMember(SetMemberBinder binder, object value) { dynamicMembers[binder.Name] = value; return true; } public override bool TryGetMember(GetMemberBinder

SignalR Adding/Removing Connections from a dictionary and finding Group values from dictionary

北慕城南 提交于 2019-12-23 05:22:48
问题 I have Organizations that login to an asp.net website and when each member logs in I add their ConnectionId and OrganizationId to a static ConcurrentDictionary named OrganizationMembers in a SignalR Hub OnConnected override. I do this so I can send data to a page callback function that contains data relative only to that Organization (SignalR Group). The OrganizationId will represent the SignalR Group that I send data to. Also in the OnConnnected method, I add the OrganizationId and

How to design parallel web api in c#?

て烟熏妆下的殇ゞ 提交于 2019-12-23 05:13:38
问题 I am trying to design a web api that can get data from an external server but with limitations. I'm trying to figure out how best to design it to be efficient. My api has an endpoint that takes an input. It is is a domain name like tom@domain.com . My endpoint then makes an http call to the domain to get an auth token, then makes another call to that domain with the username to get some data which is returned to the client. However my api can accept multiple usernames (comma delimited like

Async TCP Server in .net 4.5 using asyn and await, data loss is happening

谁说胖子不能爱 提交于 2019-12-23 05:00:56
问题 I have to implement asyn tcp serve in .net 4.5 using async & await for this by referring the Link I have implemented the server My server code is as below public class AsyncEchoServer { private int _listeningPort; public AsyncEchoServer( int port) { _listeningPort = port; } public async void Start() { IPAddress ipAddre = IPAddress.Parse("192.168.2.4"); TcpListener listener = new TcpListener(ipAddre, _listeningPort); listener.Start(); LogMessage("Server is running"); while (true) { try { var