I'm following a video tutorial where I'm required to create an empty ASP.NET Web Application with MVC, using Visual Studio 2015, being new to ASP.NET world, I'm following step by step. I got my project created well, next step adding a View from an existing Controller, I got hit by [...] read more
I am having an issue with starting Visual Studio 2017 Enterprise and I cannot report a problem to Microsoft's Developer Commnuity because it requires running Visual Studio 2017. Crap! I was updating VS 2017 with an update from this week and during this my PC crashed and I had to [...] read more
I have rebuilt my solution and got the following compilation error: > Error 9 'Could not load file or assembly 'ComponentArt.Web.UI, > Version=2009.1.1819.35, Culture=neutral, PublicKeyToken=9bc9f846553156bb' or > one of its dependencies. Invalid pointer (Exception from HRESULT: 0x80004003 > (E_POINTER))' D:..\MyProj.Account\LC The dll is in infra folder and is moved finaly [...] read more
I have a test fixture in which I initialize my SQLite in-memory dbcontext, shown below: public static MYAPPDBContext Create() { var options = new DbContextOptionsBuilder<MYAPPDBContext>() .UseSqlite("DataSource=:memory:") .Options; var context = new MYAPPDBContext(options); context.Database.OpenConnection(); // this is where exception is thrown context.Database.EnsureCreated(); return context; } When I call the Create() method, [...] read more
So this is a Windows 10 Pro 64 bit version 1607 system, Insider edition on a slow ring. Some days ago it was repeatedly failing KB3176934 with the same 0x800F0922. I didn't find out the root cause and how to prevent it. My purpose is to find other who has [...] read more
I've got one issue with iText right now. I've created a WindowsForms application with C#, it uses iText for generating pdf files with orders. I'm using it in my work, just to save some time and simplify my work a bit, but it's only for me. About a week ago [...] read more
> OLD TITLE: iTextSharp convert HTML to PDF "The document has no pages." I am using iTextSharp and xmlworker to convert html from a view to PDF in ASP.NET Core 2.1 I tried many code snippets I found online but all generate an exception: "The document has no pages." Here [...] read more
I'm playing around with Q#, which uses C# as a driver. I'd like to pass a Qubit object to the Q# code but it isn't working as expected. C# Driver using Microsoft.Quantum.Simulation.Core; using Microsoft.Quantum.Simulation.Simulators; namespace Quantum.QSharpApplication1 { class Driver { static void Main(string[] args) { using (var sim = new [...] read more
I am working on an asp.net mvc-4 web application inside visual studio 2012 professional. last week everything was working fine, where i were able to debug the project. but today when i debug my project i got this error:- > HTTP Error 500.0 - Internal Server Error An error message [...] read more
I'm writing unit test for my UserRepository class where I'm using AutoMapper ProjectTo<T> Queryable Extensions for projection. Here is how the class looks like: public class UserRepository:IUserRepository { private readonly UserManager<UserEntity> _userManager; private readonly IConfigurationProvider _mappingConfiguration; public UserRepository( UserManager<UserEntity> userManager, IConfigurationProvider mappingConfiguration) { _userManager = userManager; _mappingConfiguration = mappingConfiguration; } [...] read more
Using SqlSugar ORM, based on blazor, dependency injection business service, an error is reported when calling, and it is empty。 SqlSugarService: public static class SqlSugarService { private static readonly ILog log = LogManager.GetLogger(typeof(SqlSugarService)); public static void AddSqlSugarSevice(this IServiceCollection services) { if (services == null) throw new ArgumentNullException(nameof(services)); services.AddScoped<ISqlSugarClient>(o => { [...] read more
I started installing VS and then my computer turned off suddenly (due to overheating). When I was reinstalling it, an error message appeared saying: Can't install in a non empty folder. So I deleted the folder C:\Program Files (x86)\Microsoft Visual Studio\2017\community Then, when I tried to install it, it failed. [...] read more
I've been trying to figure out why my console application fails the instant I introduce a new package. Using IdentityModel.OidcClient and Microsoft.AspNetCore.Server.Kestrel only works, but when adding Microsoft.Extensions.Configuration.Json it throws exception. I don't reference the new package in code either, I just add it to the project. Steps to reproduce: [...] read more
i've wanted to try out the SSML but everytime i try to run my code i get a null exception at SetOutputToDefaultAudioDevice() . I am using the Example Code from Microsoft: using System; using System.Speech.Synthesis; namespace SSML_Test { class Program { static void Main(string[] args) { // Initialize a new [...] read more
I have an ASP.NET framework web application that processes documents and returns it in a template contract. If I send it a smaller document (143KB) it processes fine and sets the template contract properly (ie. template contract is not null): Template set properly for smaller file If I try a [...] read more
I am using .NET 5 version 5.0.100-rc.1.20452.10 , ASP.NET Core Blazor server-side. I mimic this example https://github.com/DevExpress-Examples/blazor-server-dxdatagrid-export/blob/19.2.2%2B/CS/DxDataGridExportingWithReports/Pages/Index.razor#L22 My error System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=acc133blazor StackTrace: at acc133blazor.Pages.DeclaredData.Account.AccountsPage.<OnInitializedAsync>d__10.MoveNext() in D:\acc133blazor\acc133blazor\Pages\DeclaredData\Account\AccountsPage.razor:line 144 @foreach (Tuple<string, string> urlInfo in ExportUrlInfo) { <a href="@urlInfo.Item1" download target="_blank">@urlInfo.Item2</a> } [...] read more
Is there any way that I can have multiple views on a single Observable Collection, with different filters, that I can Refresh? I have an Observable Collection called Proficiencies. I have three list boxes, each should display a subset of the Proficiencies items, filtered on a value within the Proficiencies [...] read more
I have a DataGridView (DGV) that I am adding items to from a SQLite DB MANUALLY My setting for the Selection Mode have been CellSelect and FullRowSelect may have tried others The Errors and Issues are varied depending on where the user clicks on the DGV The code as it [...] read more
I am trying to 'pause' a bot conversation and resume it via a ProActive Message. The way I have been trying to do so is by ending the dialog turn to 'pause' the conversation. Following I'm using ContinueDialogAsync in my ProActive message to 'resume' the conversation. Below is how I'm [...] read more
I am using iTextSharp with C# to fill an editable PDF. Everything was working fine, but suddenly I am getting an error on the PdfStamper line. PdfReader pdfReader = new PdfReader(File.ReadAllBytes(pdfTemplatePath)); PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(newFile, FileMode.Create,FileAccess.Write)); AcroFields pdfFormFields = pdfStamper.AcroFields; The error is System.NullReferenceException HResult=0x80004003 Message=Object reference [...] read more
I am trying re-parent controls from one panel to another like this: oldPanel.Children.Remove(control); newPanel.Children.Add(control); Which works fine with every control until i try to do it with the LAST child of the oldPanel, where i get: System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=Avalonia.Visuals StackTrace: [...] read more
I'm using EF6. The generated code is something like: public partial class MyDataContext : DbContext,IMyDataContext { public MyDataContext() : base("name=mydata") { } public virtual DbSet<getProjectsDraft> getProjectsDrafts { get; set; } } and the dbcontext interface is like this: public interface IMediciDbContext : IDisposable { DbSet<getProjectsDraft> getProjectsDrafts { get; set; } [...] read more
After upgrading and changing my project to target network .NET 4.8 and upgrading used Nuget packages to the latest version in package manager. This brought up a host of problem. Most pressing was the inability to use Geography data type in DataReader and Entity Framework. The error in data reading [...] read more
I have a code for crawling through all PDF files on web page and download them to folder. However now it started to drop an error: > System.NullReferenceException HResult=0x80004003 Message=Object reference not > set to an instance of an object. Source=NW Crawler > StackTrace: at NW_Crawler.Program.Main(String[] args) in > C:\Users\PC\source\repos\NW [...] read more
I have been trying a lot of different solutions with wait and async. Nothing seems to work. I was not able to find solution that actually fully waits until page has been fully loaded. All codes are waiting some time but not until page has been loaded and I am [...] read more
I am building a C# Excel Add-on to replace string xxx to yyy and find files in batch in a given folder path: string replace = "xxx"; string replacement = "yyy"; foreach (FileInfo file in listOfFiles) { foreach (Excel.Worksheet xlWorkSheet in xlWorkBook.Worksheets) { Excel.Range r = (Excel.Range)xlWorkSheet.UsedRange; Excel.Range first = [...] read more
I have C# function that saves a supplied image into a PDF file using VSTO. But it is throwing: > System.AccessViolationException HResult=0x80004003 > Message=Attempted to read or write protected memory. This is often an > indication that other memory is corrupt. Source= StackTrace: I have tried saving in various ways: [...] read more
I am having an issue with updating existing file in Google Drive using Google Drive API v3. From the code below create (uploading document first time) works just fine (else statement) however, update fails. I have validated that fileId is correct. return file.Id; throws an exception fill is null. Any [...] read more
SSIS Package Info I have a package which manipulate some data(received from an API), writes it into SQL Server Table and also converts it to ADODB Recordset to send it remotely to SAP. The package has no SQL or file connections (I'm connecting and writing into the database via c# [...] read more
I have two data tables and want merge columns and create as third table. //Given dt1 {A(PK),B,C,D} dt2 {a(PK),b,c,d} //Want dtResult {A,B,C,D,a,b,c,d} Do not want to lose ExtendedProperties so not Selecting DataColumn.ColumnName and adding as columns. Code: DataTable dt1 = new DataTable(); dt1.TableName = "dt1"; dt1.PrimaryKey = new DataColumn[] { [...] read more
I have been trying to deploy a Unity application to the Hololens 2 emulator for a while now and have not found a solution that works. I have run through every troubleshooting document and uninstalled and reinstalled every program to try and find the right fit but keep getting the [...] read more
I am experiencing a problem with Excel Worksheet.Copy method in VSTO. The worksheet to be copied is stored as a resource file. The resource file is read every time the template needs to be copied. The code works perfectly fine when the template sheet is imported for the first time. [...] read more
I'm trying to run a Hello World kind of problem for a HoloLens on emulator but it is showing error: The following unexpected error occurred during bootstrapping stage 'Connecting to the device '<device>'.': NullReferenceException - Object reference not set to an instance of an object. [0x80004003] I have tried making [...] read more
I am new to azure. I am trying to create ResourceGroup then trying to deploy a VM. But I am getting exception during accessing resourcegroups. I am following MSDN example given here: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/csharp-template I tried different subscription but no luck. Couldn't find any pointers online for this issue or I [...] read more
When using sfc /scannow on my Windows 10 Pro 64bit system I am geting error "windows resource protection could not run the requested operation" This is from the CBS log: > 2017-02-01 10:29:29, Info CBS TiWorker: Client requests SFP repair object. > 2017-02-01 10:29:29, Info > CSI 00000002@2017/2/1:09:29:29.390 WcpInitialize (wcp.dll [...] read more
I am trying to install SQL 2014 on my Window 10 laptop and during rule checking I receive the following error: SQL error [https://i.stack.imgur.com/jI2SR.png] When I check for the Windows Management Instrumentation service on my laptop I find only Winmgmt which cannot be started due to the following error: Services [...] read more
I own a Asus vivobook, which has a Windows 8 pro installed and has a secondary SSD for faster boot up only, not storage. When I try to upgrade to 8.1, I hit a fail upgrade 0x80004003. Now every time I login, the 8.1 installer will run at the background, [...] read more
Sqlite crashes on SqliteConnecion I have an application that uses Sqlite. I has been working perfectly for a couple of year. I'm using Nuget System.Data.SQLite.Core 1.0.113.7 I tried to run it and i get this exception. > System.AccessViolationException HResult=0x80004003 > Message=Attempted to read or write protected memory. This is often [...] read more
I'm trying to implement some code whereby I get the parent of the clicked toolstipmenuitem upto the root. If I query openly I eventually get a null exception from the one after the last parent, as you may expect where there is no parent to parent to get the parent [...] read more
I am trying to develop UWP with gRPC. I got channel ArgumentNullException on release build, but debug build is fine and gRPC also works fine. It seems to related to UWP limitation (loopback). I also use checknetisolation command to add exception for my package. But it's still fail. Is there [...] read more
I am using code to read all kind of files and to achieve that i am using code available in below link. https://www.codeproject.com/Articles/13391/Using-IFilter-in-C This code internally using OFFFILT.DLL. This dll available in below two location in any windows system. C:\Program Files\Common Files\Microsoft Shared\Filters\OFFFILT.DLL C:\Windows\System32\OFFFILT.DLL My application using OFFFILT.DLL from program [...] read more
I am new to C# / EF Core and don't understand why I am getting a null reference exception: > System.NullReferenceException > HResult=0x80004003 > Message=Object reference not set to an instance of an object. > Source=WMS > > StackTrace: > at > WMS.Pages.Artikels.Artikel_Verkauf_erfassen.ArtikelVerkaufErfassen.d__33.MoveNext() > in D:\Project Arbeit\Code\WMS\Pages\Artikels\Artikel Verkauf > erfassen\ArtikelVerkaufErfassen.razor.cs:line [...] read more
This also might not be the way to do it but if it isn't I can't find the right one anywhere. Anyways this is my code: await discord.UpdateStatusAsync(new DiscordGame("?help")); // Line 101 And this is the error System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=DSharpPlus [...] read more
I'm using EF Core 2.2 to connect to an Oracle11g database (using these old versions is a must), when I try to query one of my tables it throws a NullReferenceException in the EF Core external code. The Query: string username = "Administrator"; var user = _context.Users.Where(x => x.UserName.ToUpper() == [...] read more
VS 2019, .NET 5, AngleSharp* V0.14.0 I am looking for some clarity on the steps needed to evaluate the JavaScript inside a script tag. Here is the JavaScript I am trying to evaluate: <script> $(function () { $("#TextBoxPIN").bind('focus mouseenter', function () { $("#PIN").css("color", "#fc4258"); }); $("#TextBoxPIN").bind('blur mouseleave', function () { [...] read more
I am creating a partial Model Async due to constraints of a library I am using. I call the partial and return a Model containing my progressModel data. The model's ProgressModel has data when it leaves the server and when it hits the partial I get an Object Reference Null [...] read more
when i execute the code below, it generates an exception. where am i going wrong? Code that generates exception specifically extractor.Extract: public Visit Get(long id, bool loadGraph = false) { const string sqlVisit = @"SELECT * FROM Visit WHERE Id = @VisitId;"; const string sqlCC = @"SELECT * FROM ChiefComplaint [...] read more
I am just starting to use Entity Framework Core with an Oracle database in a .NET Core 3.1 project and I keep running into problems when trying to call a user-defined function. The function in the database looks like this: FUNCTION fnc_hourly_data( p_quality IN t_quality_configurations.quality%TYPE DEFAULT NULL, p_date IN DATE [...] read more
I tried using Edge.js for using .Net library with Node.js. I was able to use one of dll's successfully but for one of my other dll I get below error. Same error for every modification. Code is input = { template: 'C:\\Test1.docx', test: 'C:\\Test2.docx' }; var Comparision = edge.func(function(){/* #r [...] read more
So I'm working on a school project. I use blazor in the frontend and FluentValidation to validate forms. First, the exception: > System.NullReferenceException > HResult=0x80004003 > Message=Object reference not set to an instance of an object. > Source=TemperBapes > StackTrace: > at TemperBapes.Pages.Register.BuildRenderTree(RenderTreeBuilder __builder) I get the exception when calling [...] read more
I am trying to do a unit test with Moq for this method: public class XsService : EntityResourceService<XModel, string>, IXResourceService<XModel, string> { private readonly IXsEntityRepository<XModel, string> XEntityRepository; Public XsService( iCorrelationContextAccessor correlationContextAccessor, IJsonApiContext jsonApiContext, IXsEntityRepository<XModel, string> XEntityRepository) : base(jsonApiContext, XEntityRepository) { this.XEntityRepository = XEntityRepository; } public async Task<IEnumerable<XModel>> GetXsAsync(UModel uModel) { [...] read more
I am wanting to call a C DLL function from C#. The function is described in the C include header file as: #ifdef _WIN32 #ifdef CMGO_BUILD_DLL #define CMGO_DLL_API __declspec(dllexport) #else #define CMGO_DLL_API __declspec(dllimport) #endif #define CMGO_API_CC __stdcall #else #define CMGO_DLL_API #define CMGO_API_CC #endif typedef void* CMGO_DATACHANNEL_HANDLE; CMGO_DLL_API int CMGO_API_CC cmgo_create_datachannel(const [...] read more
Now I have a controller: public async Task<IActionResult> Location() { Models.LocationModel Location = null; //some logic return View(Location); } And here is the View: @model Vishdo.Models.LocationModel <div> <h5>@Model.City</h5> <span>@Model.Name</span> <span>@Model.Phone</span> </div> When I access the View by the URL(https://localhost:44372/home/location) directly, all works well. Now I add it into the _Layout.cshtml [...] read more
I am trying to add a Data Table to a DataTable list (post a filter operation) that belongs to a kind of modal class. I am getting the below exception on my debug statement _return.SearchResult.Add(_i);. I am getting the same error in my actual statement as well _return.SearchResult.Add(_t);. Kindly help [...] read more
I have been trying to install SSIS for the last 3 days but every time this error pops up. I have already tried reinstalling Visual Studio, MSSQL Server as well as SSDT and performed reconfiguration/re-installation at least 10 times, tried running it on administrator mode as well as, clearing the [...] read more
I have python code that I am using Cython to convert to C (in order to call from C# 32bit application). 1. When I use MSVC x86 Native Tool Command prompt to run: > python setup.py build_ext --inplace --compiler=msvc I get the error: python38.lib(python38.dll) : fatal error LNK1112: module machine [...] read more
I need some ideas how to increase performance to read from CSV file. I made one version is working well, but performance is no longer desirable when we have more than 200 000 line per CSV, the processing time is taking a lot of time, and the importing process is [...] read more
Here is the method for generating HTML table: public static string CreateHTMLTable<T>(IEnumerable<T> list, params Func<T, (object, string)>[] fxns) // Used for generating HTML tables for Outlook { var sb = new StringBuilder(); sb.Append("<table>\n"); sb.Append("<thead>\n"); sb.Append("<tr>\n"); foreach (var fxn in fxns) sb.Append("<th>").Append(fxn(default).Item2).AppendLine("</th>"); sb.Append("</tr>\n"); sb.Append("</thead>\n"); foreach (var item in list) { sb.Append("<tr>\n"); [...] read more
Use mathtype sdk 6.9 to convert many wmf to mathml file, after converting several hundreds of wmf files successfully, it crashed (unhandled exception) in below position of MathTypeSDK.cs(MTXFormSetTranslatorMgn function) retCode = MTXFormSetTranslator(options, transName); the exception details are: System.AccessViolationException HResult=0x80004003 Message=Attempted to read or write protected memory. This is often an [...] read more
I'm using Azure Functions V3 (.Net Core 3.1) and trying to call an Entity FrameWork class built using EF 6.4 (.Net 7.2) and Entity Framework is throwing a NullReferenceException. The same call succeeds while using .Net Core console app instead of Azure Function. Appreciate your help here. Here is my [...] read more
My problem is as you read in the above title - My project is in .NetCore. Am doing some calculations and returning some value from my controller to the related view. I have used Product as model class in my application. My controller code - [Route("ProductDetail")] [HttpGet] public IActionResult ProductDetail(int [...] read more
Sorry, I'm not sure how to phrase this question. I have a issue where I'm building a VS21010 Solution in both debug/Mixed CPU and in release. From what I can tell in the Configuration Manager all projects are set to build in Debug/Mixed CPU. However in my automated build t [...] read more
I'm trying to insert some id from MySQL Table T1 in Server A, into MySQL Table T2 in Server B inside an SSIS package. I've tried ADO.NET source for reading data and ADO.NET destination and it gives me this error: > [ADO NET Destination [2]] Error: System.NullReferenceException: Object > reference [...] read more
My wpf uses two ChromiumWebBrowser(Cefsharp.Winforms) instances, one is for my website, one is for displaying pdf file, when I close the MianWindow, there is a crash like below: System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=CefSharp.WinForms StackTrace: 在 CefSharp.WinForms.ChromiumWebBrowser.InternalDispose(Boolean disposing) 在 CefSharp.WinForms.ChromiumWebBrowser.Dispose(Boolean disposing) 在 System.ComponentModel.Component.Dispose() [...] read more
I'm in the midst of upgrading our Unity 2018.3 + MRTK project to Unity 2019.4. I've already encountered several issues while upgrading and thought I'll do a simple Unity 2019.4 + MRTK based application which simply consists of a cube placed in scene in order to better understand what's happening. [...] read more
I want to disable some items of combobox by specific conditions. For this issue, I used multibinding. If I described all items of combobox in xaml, there is no problem. But I want to populate combobox items programmatically. So in this case , I could not get items, returns null, [...] read more
ASPNET Boilerplate or ASPNETZero have the ability to integrate with LDAP. Apparently the configuration is easy, but it only lets me configure a Domain, a User and Password. I was wondering if anyone has a working example with a test server of LDAP? Currently I have enabled the LDAP Authentication: [...] read more
I generated a pfx file with the following commands openssl ec -in apple-private-key.pem -pubout -out apple-public-key.pem openssl req -new -key apple-private-key.pem -x509 -nodes -subj "/CN=apple.my.com" -out certificat.pem openssl pkcs12 -in certificat.pem -inkey apple-private-key.pem -export -out certificate.pfx and when I try to load it only with the flag X509KeyStorageFlags.MachineKeySet this flag [...] read more
I created this simple WebAPI project containing the following library class * Coordination (ServiceLayer) * Domain (BusinessLayer) * Data (DataLayer) * Dtos (Dtos for webapi) Basically WebAPI project calls(reference) Dtos, and Coordination. Coordination Calls Domain and Domain call Data. This is what my structure look like. enter image description here [...] read more
I want to transmit iBeacon from windows PC and I found this library https://github.com/AltBeacon/windows-beacon-library in C#. I don't have any knowledge about this language. I am trying to run this code in Visual Studio C# console application using System; using Altbeacon.Beacon; namespace TransBeacon { class Program { static void Main(string[] [...] read more
I have a Xamarin.Forms application that uses FreshMvvm. On an attempt to open a particular page with this code: await CoreMethods.PushPageModel<DistributorsLocatorPageModel>(); after the execution passes the page's Init() method and all properties, the app crashes with the following error: > System.AccessViolationException > > HResult=0x80004003 > > Message=Attempted to read or [...] read more
I have a method that is supposed to take customer names, customer towns, and the fire extinguishers + serial numbers of each extinguisher that belongs to those customers, from an excel file, and write that information to a bunch of separate excel files depending on what customer the extinguishers belong [...] read more
UPDATE: The core issue is ABPSesssion gets null after the postasync request. i think if i can regain back my abpsssion it will work. I am trying to make an api call of postAsync type. Issue is i am getting the response perfectly well now when i i try to [...] read more
I am dynamically loading a DLL originally written in C++ in a C# program and hand over an array as an argument like this: // That's only for being able to load the DLL dynamically during runtime [DllImport(@"C:\Windows\System32\kernel32.dll", EntryPoint = "LoadLibrary")] public static extern IntPtr LoadLibrary([MarshalAs(UnmanagedType.LPStr)] string dllToLoad); [DllImport(@"C:\Windows\System32\kernel32.dll", CharSet [...] read more
I would like to train in c# and I created a WPF project in which are displayed some persons(with each a name and a work), and by selecting a field ('name' or 'work') and a search string, I would get all the persons filtered. for example, the field is 'name', [...] read more
The below code that converts a PDF document to XOD using PDFNet nuget package (v6.8.56.6513) throws an exception. However, the previous version (v6.8.2.65223) of the nuget package works without any problem. To produce the issue, please download this file. Platform: .Net Framework v4.7.2, x64. using System; using pdftron; namespace PdfTronTest2 [...] read more
I have a database in SQL Server stored locally with a number of different tables, all connected together by different types of relations (one-to-many and many-to-many). You can see some of theme like this: enter image description here [https://i.stack.imgur.com/ObIAG.png] I created a Web API for these with Entity Framework on [...] read more
I'm trying to display the simple element of the array or value, below is my JSON string(an API from python pandas) { "msg": "success", "state": 10000, "data": { "data": [ { "index": 0, "test_1": 110, "test_2": "000001", "test_3": "CN", "test_4": "Bank", "test_5": 893, "test_6": 229 } ], "schema": { "fields": [...] read more
I was trying to cancel a MySqlCommand using a CancellationToken. The query executes successfully when cancellation is not requested. public async Task<int> ExecuteNonQueryAsync(string connectionString, string query, CancellationToken cancellationToken) { int affectedRowsCount = 0; await Task.Run(() => { using (MySqlConnection connection = new MySqlConnection(connectionString)) { using (MySqlCommand command = new MySqlCommand()) [...] read more
I'm making a call to an api, and then deserializing that response to a list, when i am then trying the response to a new list: public async Task<IEnumerable<RoadDto>> GetRoadStatusDetail() { List<Road> road = await CallApi(); return road .Select(x => _mapper.Map(x)); } private async Task<List<Road>> CallApi() { HttpClient client = [...] read more
I'm working under Visual Studio 2017. I want to retrieve the comments the user is typing in the form. In order to do so, if there are no datas in the db, I'm using a post request, and if there are datas I'm using a put request. The post is [...] read more
enter image description here [https://i.stack.imgur.com/zPxLj.png]Trying to login to an Intranet site using WinForms and C#. Following is the code for login - webbrowserObject.Document.GetElementById("USER").SetAttribute("value", Properties.Settings.Default.UserEmail); webbrowserObject.Document.GetType("password").SetAttribute("Value", Properties.Settings.Default.UserPassword); webbrowserObject.Document.GetElementById("loginbtn").InvokeMember("submit"); Getting following error - Severity Code Description Project Path File Line Suppression State Error CS1501 No overload for method 'GetType' takes 1 arguments [...] read more
I have a MainWindow with a Stackpanel full of buttons. I click on a button and a Frame(Frame1) is populated with a Page(page1). Page1 has its own stackpanel with a list of buttons. I also have Frame2 to the right of Frame1. Both Frame1 and Frame 2 are in the [...] read more
I'm trying to execute an sp in ef core. I have defined a data model class for the sp results. It's been added as a DbSet in the context public class GroupedCountResult { [Required] [Column("varchar(100)")] public string Title { get; set; } [Column("varchar(20)")] public string Colour { get; set; } [...] read more
I have two data tables and want merge columns and create as third table. Do not want to lose ExtendedProperties so not Selecting DataColumn.ColumnName and adding as columns. Code: DataTable dt1 = new DataTable(); dt1.TableName = "dt1"; dt1.PrimaryKey = new DataColumn[] { dt1.Columns.Add("A") }; dt1.Columns.Add("B"); dt1.Columns.Add("C"); dt1.Columns.Add("D"); DataTable dt2 = [...] read more
I'm trying to use this DLL through edge-js. When the code is built as just a simple c# program, it works without any issues. Unfortunately, when the port is coded over to edge-js it has trouble with Nlog, noting that it or its dependancies can't be found. I'm not too [...] read more
I've had this application running for over a year now with no issue and all of a sudden it's throwing an error on the code below. I have no idea why it started doing this. This is a production application. I've tried a few of the fixes found on the [...] read more
Anytime I try to run this c# timer, the application errors out saying "parameter cannot be null: object source" I based my implementation off of a microsoft docs page. It's worth noting that this happens when the event is synchronous as well. private void SetTimer() { // TODO set to [...] read more
I read about XML XDocument and running a few test but now I get the same first node on second lap in the foreach Here´s my C# code for the CRUD get: public IActionResult GetBookItems() { List<BookItem> BookItems = new List<BookItem>(); XDocument doc = _db.GetXmlDb(); foreach (XElement element in doc.Root.Descendants()) [...] read more
Referring to Radio Button's using the below code to try to find the checked button keeps throwing NullReferenceException. I've tried referring to both it's .name and .tag properties, and they both worked on the first couple tries but then they started throwing NullReferenceExceptions, despite no changes to what they would [...] read more
can someone please confirm this is a bug? Loading a WMF file as WmfImage from a file (see code, method 1) works, but loading it from a byte array (method 2) fails. PdfWriter writer = new PdfWriter(dest); PdfDocument pdf = new PdfDocument(writer); Document document = new Document(pdf); // Method 1: [...] read more
I want to get and set visible columns in the Details View. I have a shell extension (implemented with a 3rd party library), and I add a menu item to the context menu when the user right-clicks on the folder background. By adding IObjectWithSite to my extension, I've been able [...] read more
I'm failing to un-subscribe to an event while using a BackgroundWorker to handle when the un-subscribe event should be fired. I can un-subscribe in the AsyncRunner but not in BackgroundWorker1_RunWorkerCompleted. Context: This is part of a plug-in for Autodesk Revit. We want to update some files in the background but [...] read more
WinForms: I am new to Cefsharp and C# , just wrote a freeware 'Kid Safe Browser' in VS vb.net in visual basic , but IE11 is too limited . I am getting "Object reference not set" for all Buttons . How to fix this ? For example: How do I [...] read more
I have using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Media; using Microsoft.Win32; namespace Just_play_sounds_2 { public partial class Form1 : Form { private SoundPlayer soundPlayer; private RegistryKey reg; public Form1() { InitializeComponent(); this.WindowState = FormWindowState.Minimized; } private void [...] read more
In order to eliminate the need to write a really long Switch Statement, I want to get the object property from a collection that contains data. Here is my code: public class NCAABArchive { private int id; public int HScore; public string Road; public int RScore; public double Line; public [...] read more
I have a custom control template for my CalendarItem, and it works great except that when you click the month (<Button x:Name="PART_HeaderButton">) the app crashes with: > System.NullReferenceException: 'Object reference not set to an instance of an > object.' Here is most of the error detail. System.NullReferenceException HResult=0x80004003 Message=Object reference [...] read more
I have the following code in a controller. private ApplicationSignInManager _signInManager; private ApplicationUserManager _userManager; private ApplicationDbContext userDB; public ApplicationUserManager UserManager { get { return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>(); } private set { _userManager = value; } } public async Task SendEmail(string user_id, string subject, string user_email ) { await UserManager.SendEmailAsync(user_id, subject, [...] read more
I have the following code in Visual basic, Visual Studio 2017: Private Sub OpenFileDialog1_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk CType(Controls(currEdit), Control).Text = OpenFileDialog1.FileName.ToString() End Sub and I am getting this error that is not resolved ... I am following a video tutorial of making a DOCK / Louncher [...] read more