Questions

Add web service reference from behind a proxy server

I'm using vs2010. In a simple console app I try to add a service reference to `http://***/service1.asmx` , old asmx service. My computer is behind a proxy server, so i get an error : > "The remo...

30 Apr at 13:34

No more post back after file download in sharepoint

I tried to download a file from sharepoint. But after I download this file, I can't click on other buttons. What is wrong with my coding? **This is my first way.** ```csharp Response.AppendHe...

30 Apr at 13:34

Sleep task (System.Threading.Tasks)

I need to create thread which will replace photo in [Windows Forms][1] window, than waits for *~1second* and restore the previous photo. I thought that the following code: ```csharp TaskSchedul...

Graphic - DrawLine - draw line and move it

In my .net c# program i draw few lines using values from text boxes (i use DrawLine function). I want to be able to move one of this lines by clik on it and move this line with mouse - is it possible?...

30 Apr at 13:31

Find node when traversing tree

I want to implement a method that will enable me to find a node in a tree. The way I do it is recursively using global variables to know when to stop. **I have the class:** ```csharp class Nod...

30 Apr at 13:30

Why use events for what I can do with Delegates?

I know Events are always associated with Delegates. But, I am missing some core use of Events, and trying to understand that. I created a simple Event program, as below, and it works perfectly fine...

30 Apr at 13:28

Sharing DTOs between my API, Blazor web app and WPF client

I have recently been revisiting a project from a year ago where I had an ASP.NET web API and a WPF client. The WPF client would call the API and each project had a separate models folder where I dupli...

3 May at 15:59

How to handle no matches case in List.First in c#?

In [IEnumerable.First][1] function, how do I handle the case if there are no matches? Currently it just crashes... ```csharp MySPListItem firstItem = itemCollection.First(item => !item.isFolder); ...

30 Apr at 13:26

GridView Command Arguments out of sync after dynamic row inserts

I have a gridview (for displaying data only) with multiple LinkButton objects in each row. In the gridview's DataBound function, I iterate through the rows of the gridview and dynamically to add new "...

3 May at 14:34

Calling multiple external apis.

I'm creating two azure functions, and each one will call different external api. I'm wondering about approach to this. I currently have a `IApiService` and `ApiService` which basically is doing th...

3 May at 14:33

C# how to convert WORD to PDF?

I'm searching for free method to convert word to pdf. I searched for free cli tools, for libraries, but there is no free method i found. I only found this library from nuget - "Microsoft.Office.Intero...

3 May at 14:29

c# csvreader delimiter in value

How parse csv with text in? example csv: ```csv name;comment;count; firstName;LastName;someComment;5 ``` I found on the net that you need to escape the value in the column with the symbol ...

3 May at 14:15

RPC calls - state of the art

Up until recently we had a database where only a client for the classic .NET Framework was available (ODBC setup would have been a horror). My application basically is a webservice (implemented in WCF...

3 May at 14:14

Covariance in C# .NET 4 Framework

Is it possible to cast a `List` to `List` in C# 4.0? Something along these lines: ```csharp class joe : human {} List joes = GetJoes(); List humanJoes = joes; ``` Isn't this what co...

30 Apr at 12:19

Elegant alternative to int.TryParse

I feel that every time I use `TryParse` that it results in somewhat ugly code. Mainly I am using it this way: ```csharp int value; if (!int.TryParse(someStringValue, out value)) { value = 0...

30 Apr at 12:10

ASP.NET 6 CORS problems after adding IMiddleware for authorizing users

Recently, in a project I'm working on, I added a Role creation system. There are many actions in the system and we decided to let the user create their own roles. I added an implementation of IMiddlew...

25 Jan at 11:21

Why do ServiceStack examples usually have a function definition of "object Any"

I notice most if not all ServiceStack example have services of this form: `public object Any(Request request) { }` Even if the function is always returning an integer. Why declare the function as `pub...

19 Jan at 05:7

ServiceStack Timeout - ASP.NET executionTimeout

I'm using ServiceStack's JsonServiceClient but I've seen that despite setting the client timeout, the HTTP call still goes wrong after a certain period of time. I fixed this by setting the executionTi...

12 Jan at 17:31

How to set up Basic Authentication with sessionId in ASP.NET Core MVC?

I have an ASP.NET Core MVC application in the front-end and I have a back-end service which is built with ServiceStack. This service has BasicAuth, which requires to send encrypted username+password a...

StackTrace inside an Exception in .Net Xamarin

Inside my .Net Xamarin app, I don't get a stack trace with this code: ``` new Exception().StackTrace ``` Why not, and how can I get it? If I call the following code, I get a `stackTrace` with one fr...

Non-existent table when RegisterTable | PocoDynaamo c#

I am trying to use PocoDynamo query for my dynamoDb. When I used POCO, I have non-existent table error. ``` var db = new PocoDynamo(dynamoDBClient); db.RegisterTable<Table>(); ``` I have faced this ...

30 Dec at 10:44

Columns Physical Order in OrmLite

regards everybody: I have a data model for example: ``` [Alias("log")] public class Log { [AutoIncrement] [PrimaryKey] [Alias("id")] public int Id { get; set; }...

23 Dec at 00:46

Why does db.select<T> is so slow when the model inherits from AuditBase?

I can observe that fetching all records from a small table (100 records) can take 1600 miliseconds, even using a ":memory:" SQLite database. This happens when the model inherits from `AuditBase`; oth...

20 Dec at 05:18

How to override password verification in ServiceStack?

I have some people who login through standard ServiceStack authentication and some people whose passwords need to be compared to Active Directory. They use the same `CredentialsAuthProvider` and I wan...

10 Dec at 08:9

How to call ServiceStack AutoQuery from AspNetCore HostedService

So I understands that ServiceStack is a different framework to AspNetcore, let's say a loyalty system where a user choose some criteria in filtering some customers using ServiceStack Autoquery, system...