Visual Studio 2019 | Visual Studio Json.NET C# Tutorials - Get Started C# is a simple & powerful object-oriented programming language developed by Microsoft. C# can be used to create various types of applications, such as web, windows, console applications or other types of applications using Visual studio. These C# tutorials will help you learn the essentials of C#, from the basic to advance level topics. These tutorials are designed for beginners and professionals who want to learn C# step-by-step. So let's get started by clicking Next. C# Test Test your C# knowledge with a quick test. Start C# Test
Creating high performance WCF services - Scott Weinstein on .Net I had a WCF service where I wanted to be able to support over a hundred concurrent users, and while most of the service methods had small payloads which returned quickly, the startup sequence needed to pull down 200,000 records. The out of the box WCF service had no ability to support this scenario, but with some effort I was able to squeeze orders of magnitude performance increases out of the service and hit the performance goal. Initially performance was abysmal and there was talk of ditching WCF entirely ( and as the one pushing WCF technology on the project this didn't seem like a career enhancing change ) Here's how performance was optimized. These are listed in the order they were implemented. Some are fairly obvious, others took some time to discover. [OperationContract] Byte[] GetData( and the implementation to var bf = new BinaryFormatter(); using (var ms = new MemoryStream()) { bf.Serialize(ms, groupeList); // and best to cache it too return ms.GetBuffer(); }
Generic Collection in C# You have learned about the collection in the previous section, e.g. ArrayList, BitArray, SortedList, Queue, Stack and Hashtable. These types of collections can store any type of items. ArrayList arList = new ArrayList(); arList.Add(1); arList.Add("Two"); arList.Add(true); arList.Add(100.45); arList.Add(DateTime.Now); The limitation of these collections is that while retrieving items, you need to cast into the appropriate data type, otherwise the program will throw a runtime exception. To overcome this problem, C# includes generic collection classes in the System.Collections.Generic namespace. The following are widely used generic collections: A generic collection gets all the benefit of generics. Learn generic collectoin List<T> in the next section.
Dan Rigsby » How to throttle a Wcf service, help prevent DoS attacks, and maintain Wcf scalability What can you do to prevent denial of service (DoS) attacks on your Wcf services? A DoS attack occurs when a flood of client requests come into a service and prevent legitimate requests from being made or slow down intended processing. At the same time, you need to be careful not to stranglehold legitimate requests and activity. Throttling Throttling is one mechanism that can be used to help mitigate the load from a DoS attack. Wcf handles throttling through the ServiceThrottlingBehavior class. or through the app.config: There are 3 properties supported on the ServiceThrottlingBehavior: MaxConcurrentCalls (default = 16) [Per-message] The maximum number of messages that can actively be processed. "The open operation did not complete within the allotted timeout of 00:00:59.9989999. You could set all the these values to Int32.Max. Recommendations: If your InstanceContext is set to "PerSession" you should set maxConcurrentCalls to be at least 25-30. Quotas
Workshop Live-Streaming: C# Scripting and Plugin Development for Grasshopper | Institute for Computational Design and Construction Live-streamed WorkshopRecordings are now available. April 26th, 27th, 28th 2018 Morning session: 09:30-13:00 (UTC+1) Afternoon session: 14:30-18:00 (UTC+1) C# provides high-performance interaction with the Rhino/Grasshopper modeling environment. This allows us to extend the capabilities of Rhino/Grasshopper, from simply automating common repetitive tasks to implementing custom advanced design algorithms that are not possible with the plain visual programming approach. Recordings of the Live Stream You can watch the recordings here Handouts Preparation If you would like to follow along and get your hands dirty, you will need the following software/tools: 2. 3.
GetType and TypeOf confusion - Joacim's view on stuff Both VB and C# have an operator called TypeOf (or typeof in C#) but they perform two completely different things. In VB there are also two kind of GetType() calls, the object.GetType() method which is part of the .Net framework and the VB language specific GetType() operator. Are you confused yet? The TypeOf, typeof, GetType operators The VB TypeOf operator is used together with the Is keyword and is used for checking if an object is of a particular type. result = TypeOf x Is String If “x” above is a string then “result” would be True otherwise it is set to False. result = x is string; The typeof operator in C# on the other hand returns an instance of the System.Type class containing type declarations of the type you pass to it. Type t = typeof(string); The VB equivalent of the C# typeof operator is the GetType operator. Dim t As Type = GetType(String) The difference between Object.GetType and the GetType operator Dim s As String Dim t As Type = s.GetType() Dim t2 As Type = GetType(String)
A quick guide to make a plugin for Grasshopper in Visual Studio 2015 | ChenJingcheng This is a quick guide of making a plugin for grasshopper using Visual Studio. For example we want to create a component to calculate the midpoint of a curve. And following is a step by step tutorial. 1. 2. 3.Now you’ve entered FirstPluginComponent.cs. This template shows mainly 5 parts which is crucial for a grasshopper component: a. basic information, where you define component name, nickname, description, category and subcategory. in our case, it should be: b. input of the component c. output of the component d. In our case, we should calculate the mid point of the curve using RhinoCommon library. e. to do so, first you create a 24 x 24 pixel icon file(.png), create a folder named “Resources” under your project in windows where you saved your project(by default it’s under documents/Visual Studio 2015/projects ), and put your icon file there. then back in Visual Studio, double click Properties, Resources, Click on “Click here to create one” Alright, you’ve finished a component. And you got it!
elmah - Error Logging Modules and Handlers for ASP.NET ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment. Once ELMAH has been dropped into a running web application and configured appropriately, you get the following facilities without changing a single line of your code: Logging of nearly all unhandled exceptions. ELMAH 1.2 Service Pack (SP) 2 now available for download. More Features Log errors to several back-end storages: Supports ASP.NET 1.x, 2.0 and later versions. ELMAH in Action Following is a screenshot of Firefox displaying the error log page as provided by ELMAH: To learn more about ELMAH, see the MSDN article “Using HTTP Modules and Handlers to Create Pluggable ASP.NET Components” by Scott Mitchell and Atif Aziz.
Grasshopper templates for v6 Grasshopper Wizards For Rhinoceros 6 / Rhinoceros WIP C# Add-on - Provides a C# project with a GH_Component-derived class and a GH_AssemblyInfo-derived class. C# Component - Adds a single component class item. Vb.Net Add-on - Provides a Vb.Net project with a GH_Component-derived class and a GH_AssemblyInfo-derived class. Vb.Net Component - Adds a single component class item. Download the Grasshopper SDK with the Rhino _GrasshopperGetSDKDocumentation command, or obtain the .chm file from the Related links section below here. In order to load the result .gha file, you can use the _GrasshopperDeveloperSettings command. Features This extension provides add-on and component wizards for Grasshopper projects. If you have an existing project You can still use the wizard to add new component even if your project already exists. Use the 'Add Item' wizard in Visual Studio. www.grasshopper3d.com More information Grasshopper utilizes RhinoCommon. Copyright (c) 2012-2016 Robert McNeel and Associates.