Newest '.net' Questions - Stack Overflow

Questions tagged [.net]

Do NOT use for questions about .NET Core - use [.net-core] instead. The .NET framework is a software framework designed mainly for the Microsoft Windows operating system. It includes an implementation of the Base Class Library, Common Language Runtime (commonly referred to as CLR), Common Type System (commonly referred to as CTS) and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++/CLI.

0
votes
0answers
9 views

Replace a poco that contains a List with a new in memory list

I have a List within a Poco that I want to replace. Example of what I have: public class PersonEmail { public int Id { get; set; } public string EmailAddress { get; set; } public List&...
0
votes
0answers
6 views

Get the text of pdf formatted .NET

I'm looking a way to get the pdf text in a formatted way in .NET C#, /bash/shell has already something similar that is pdftotext that allow you to convert pdf to text with a single command and allow ...
0
votes
1answer
19 views

How to install NLog for visual studio 2010?

I have a legacy project which does not have logging mechanism. I'm trying to install Nlog 2.0 in it but to no avail. It does not show up in the package manager search results. I tried the NLog page ...
0
votes
0answers
9 views

Docker - Running .Net Framework 4.5 Application

So I decided to dabble a little bit in the world of containers. I'm used to running VMs, but after learning more about containers I can see much better use of resources than VMs. So in my process of ...
-1
votes
2answers
46 views

Database validation in application

I have a c# application add-on from which I need to validate the schema of a database. I can't use any of the obvious frameworks due to limitations of the application I'm extending, but rather need ...
0
votes
0answers
4 views

TIPCO Spotfire IronPython Script: Prompting “Save As” Dialog along with name of file and file location in windows file explorer

I currently have the code to prompt a save as dialog with a yes/no option on Spotfire, however I would like to know how to create a dialog that also includes a way to save the file name, file type,and ...
-1
votes
0answers
10 views

Remove or disable custom controls from Word document with CustomXmlPart while filled text is leaved

Is there any way to programmatically remove custom control in Word document, after all control are filled with text from xml data into CustomXmlPart? The solution I need have to support single text ...
0
votes
0answers
27 views

Passing Information at the End of Command Path

I'm working with an old program that uses a built-in version of IE6 as the browser. There is a customizable toolbar in this program that allows you to open HTML links or open External Programs with ...
0
votes
1answer
8 views

Cannot access protected member GetService without a python subclass of Document

I keep getting this error, "Cannot access protected member GetService without a python subclass of Document" on this line of code ... "progressService = Document.GetService(ProgressService)" The ...
-1
votes
0answers
6 views

IDX12401 Exception

I am getting the error after I deployed my .net core to smartasp server, System.ArgumentException: IDX12401 : Expires '06/21/2019 11:22:30" must be after not before "06/21/2019"
0
votes
2answers
77 views

What is the best way to optimize a nested where clause that has multiple conditions?

I'm trying to find a list of ReturnItems where the quantity of a single item being returned is more than the original ordered quantity for that item. So there are 2 different lists of objects in play ...
0
votes
0answers
19 views

How to add sorting for a *Text Field to ElasticSearch Query

ElasticSearch (ver 6) is my kryptonite. I have been trying to add a sorting to a query for far too long and only getting errors in response: No mapping Fielddata is disabled on text fields by default....
1
vote
0answers
20 views

Call WCF Service from another decoupled WCF service on the same site without HttpClient

I have a plugin model architecture that creates my Restful WCF services. (It will be a couple years before we move to Web Api from WCF so, moving to Web Api isn't exactly a solution.) I have ...
1
vote
0answers
18 views

Naudio bass only

I am new to naudio library and i don't quite know how to get the amplitude form bass frequency only(25-50 HZ). I am using naudio to send live data form my PC to an arduino. The code looks something ...
0
votes
0answers
21 views

Correctly access query parameters from HttpRequestMessage

Given, a HttpRequestMessage resulting from a query to http://example.com/api/redirect?resource=aa9f2dcb-82f4-88dc-c716-dd71a1ac3802&type=x-application%2fx-share%2bjson the resulting ...
0
votes
2answers
43 views

How to get the version number of Visual Studio that built an application

I'm trying to put a build stamp on the bottom of my application with details like the build date, framework version and also the Visual Studio version (i.e., the version of Visual Studio used to build ...
1
vote
0answers
24 views

Get MethodInfo of method labeled with custom Attribute

I am decorating class methods with a custom TriggerHandler attribute. public class TriggerHandlerAttribute : Attribute { #region Data Members public readonly Type EntityType; public readonly ...
1
vote
2answers
51 views

What is the computational impact of increasingly specific decimal numbers

I am writing a mathematical function to provide the volume of a cube in order to get the total weight of an object where the weight per square inch is 0.28361111111111109 (stored as constant double) ...
-2
votes
0answers
19 views

Properly structuring c# Azure Function

I am working on developing an Azure Function in c# that is able to take multiple API data sources and make HTTP get requests to the URL. I am trying to learn how to write a proper object-oriented ...
2
votes
1answer
34 views

How to pass in HTML to a Razor Partial View?

I want to pass in HTML to my partial view, like so: @Html.Partial("_MyForm", "<button id='foo'>Process Data</button>") This currently works, but passing in strings is inelegant. ...
-2
votes
2answers
27 views

Singleton without sealed class and thread safety issues

I was asked to write Singleton in the interview today. I wrote the below, please note, I used "property set" method to set and then I returned the instance using "get" method. But I see in internet ...
0
votes
1answer
13 views

Wildcard version project dependencies

Started using .net core. We have a lot of dlls in one folder containing whole software solution developed through years. Part of it start to use .net core. We used to release patches with just a few ...
0
votes
0answers
24 views

Why does my user defined excel function in Excel DNA return random number if I call the function without parentheses?

I am making a Excel DNA excel plugin. I have created some user defined function using 'ExcelFunctionAttribute'. Now when i call this function without parentheses it returns a random number. Suppose ...
-6
votes
0answers
32 views

I want to create wpf project for network streaming like vlc does [on hold]

I have a server api which returns chunks of mp4 files. I have tried to stream the it using vlc(network streaming) successfully. Now i want to create a wpf application to do the same work like vlc. ...
0
votes
0answers
16 views

Excel file not downloading from MVC application using EPPlus [duplicate]

Trying to download the excel sheet using EPPlus in MVC app but no success. It is hitting the method but not downloading. Searched lot of ways but it didn't help. It is being called from a jqury ...
0
votes
0answers
11 views

How to get a resource under Trusted Advisor Check?

In my solution, I download Trusted Advisor Checks (via .Net SDK) . When I look at the response: { "result": { "categorySpecificSummary": { "costOptimizing": { ...
0
votes
0answers
22 views

Why am i getting Insufficient Mapping Error?

I run code first based on a pre-existing database and I'm getting a Mapping Error. I tried to put Foreign Key annotation but without success. Here it the classes mapping [Table("tablle_1")] public ...
0
votes
0answers
14 views

How to convert epplus worksheet to list?

I get excel from user into my code by using Epplus package. I have excels as ExcelWorksheet type. How can I convert the ExcelWorksheet type to a .net list? ExcelWorksheet templateWorksheet =package....
0
votes
0answers
12 views

XSD Validation Errors- Missing details on xsd schema error code

When trying to validate XML against XSD in .net core 2.2 , we are unable to get the exact schema validation error . The validation error only give details on the name of XML element which has failed ...
0
votes
0answers
7 views

Why is my WCF proxy sending JSON with Content-Type: application/xml?

Summary I have a WCF backend service running in an Azure app service, and I'm developing a proxy which will use the same interface but manipulate some messages for compatibility with a client's ...
0
votes
0answers
9 views

Intermittent error accessing Azure key vault - Keyset does not exists

I am using Azure Key Vault in my MVC web application. I connect to the Key Vault using certificate. Below is my sample code AssertionCert = GetCertificate(WebConfigurationManager.AppSettings[...
1
vote
0answers
46 views

DllImport works 32-bit, fails 64-bit (AccessViolationException)

I have built an extension for MapInfo Pro using .Net in C#. Older versions of MapInfo are 32-bit applications, the newest are 64-bit. I want my extension to work with both. While a lot functionality ...
-4
votes
0answers
47 views

C# code to return matching criteria text without global variable

I am writing a code to operate on a string. The result should be I need returning string contains "a" twice like this "aa" and "b" thrice like "bbb" and so on only if that character with this pattern ...
2
votes
1answer
32 views

How to get a instance of DbContext from pool with dependency injection during method?

I want to have DbContext in a function from the pool during a using scope I already tried to add IServiceProvider to the factory and let the factory resolve the context and put it into a UoW but then ...
2
votes
0answers
23 views

How to configure the endpoints when a SOAP client was generated with VS 2019?

Before 2019 I used to generate the clients to consume WCF services with Visual Studio 2017 or Rider (the behavior is the same). What happens is that the generated client inherits of System....
2
votes
2answers
41 views

Check if directory exists and Permissions [duplicate]

I am trying to write a code to create a file in particular directory. Although I am able to manage the code to check for file existence and also creating the directory if not exists but how to check ...
5
votes
0answers
50 views

Does this AppendFormat have any value?

I'm currently working on a project that was written a few years ago. I ran into this line: stringBuilder.AppendFormat("{0}", value); As far as I can see, the fact it is being "formatted" makes no ...
1
vote
0answers
21 views

Showing a collection association in an ASP.NET class diagram - “System.Collections.Generic.List<Type> cannot be found”

I am trying to show a collection association on a class diagram file in an ASP.NET project. For now, the diagram looks like the following: I would like to show the relation between Metrics (which is ...
1
vote
1answer
21 views

why the module of an assembly cannot be found?

I made a custom library (test.dll) and created a console application that references my library. of course I added the reference in VS. so the code is sth like: //use the type in test.dll Car c = ...
0
votes
0answers
23 views

c# equivalent of java AES decryption code

Is that anyone know how to convert the code to C#? This is the constant use to define the key private static final String KEY_ALGORITHM = "AES"; private static final String CHAR_SET = "UTF-8"; ...
0
votes
0answers
24 views

Is it possible to use $count without OData endpoint?

I have problem with count function in Odata. When I use https://localhost:44327/odata/Customers?$count=true its working correctly but with https://localhost:44327/Customers/Get?$count=true count is ...
-2
votes
1answer
47 views

get duplicate data of two dimensional list linked to a model c#

I have a model and I created a list based on this model (two dimensional list) the question is how to get another list with duplicate data of the previous list. Here is the model: class DataSetType ...
0
votes
0answers
16 views

PermutationFeatureImportance returns more features than model provides

I have a model, with 35 features. After transforming the string values into vectors, I end up with a transformed model with 54 features. After training I want to evaluate the feature weight, however ...
2
votes
1answer
55 views

Why can I declare a ref struct as a member of a class in c#7.3?

According the docs: You can't declare a ref struct as a member of a class or a normal struct. But I managed to compile and run this: public ref struct RefStruct { public int value; } public ...
2
votes
0answers
25 views

Why is this NuGet dependency missing when compiling .NET Framework project depending on .NET Standard?

I have a Visual Studio solution, with 3 projects. The top level is a .NET Framework 4.6.1 Console App (Project A). It depends on a .NET Framework 4.6.1 Class Library (Project B). Project B depends ...
0
votes
0answers
9 views

fitSharp.Machine.Exception.TypeMissingException: Type 'a1' not found in assemblies

Trying to reproduce a simple FitNesse example, run into this "TypeMissingException" problem. Tried to specify full paths, makes no difference. The paths appear to work fine. The class in the fixture ...
0
votes
1answer
14 views

IE doesn't set cookie when return File() from ActionResult

So I have a problem with a cookie not setting after returning a File only happening in IE. The logic is as follows: When use first visits the page they are returned a View User submits the form and ...
1
vote
0answers
33 views

Running Multiple .NET Core 2.2 APIs Locally with IIS

This is my first time attempting to build out an API with many different separate API projects within one solution using .NET Core 2.2. I'm really having trouble configuring all of the different ...
0
votes
0answers
28 views

Is it possible to use Entity Framework Core in a Win Forms Application? / References Not Found Warnings

I am attempting to use Entity Framework Core in a Windows Forms application. No other code has been written, this is all just initial project setup. I am receiving the following warnings after ...
0
votes
0answers
14 views

Send String array from ios to webservice .net

I want to send my all contact list from xcode to visual studio through web service and want to retrieve only those contacts which exists on database and show them on xcode .