I am getting this error System.ObjectDisposedException HResult=0x80131622 Message=Cannot access a disposed object. A common cause of this error is disposing a context that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling Dispose() [...] read more
I am trying to launch the emulator (Emulator 8.1 WVGA 4 inch 512 MB, or any other as a matter of fact) but it fails to launch. It goes to the "Loading OS" screen then throws an error box with the text "DEP6100". On VS, it says at the bottom [...] read more
I'm trying to log the usernames for users in application insights when they are doing requests. I've been trying to do it this way as: public class AppInsightsInitializer : ClientIpHeaderTelemetryInitializer { private readonly IHttpContextAccessor _httpContextAccessor; public AppInsightsInitializer(IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor) { _httpContextAccessor = httpContextAccessor; } protected override void OnInitializeTelemetry(HttpContext platformContext, [...] read more
I am trying to setup windows Auth using kesterel on blazor server side.I have the progam setup like this: I am using version 0.6.0 of Blazor server side and latest release of VS 2017. Using the out of the box blazor temnplate. You can see that I enabled "windows Auth" [...] read more
I'm getting the following exception in my custom database initializer class: > System.ObjectDisposedException occurred HResult=0x80131622 > Message=Cannot access a disposed object. A common cause of this error is > disposing a context that was resolved from dependency injection and then later > trying to use the same context instance elsewhere [...] read more
Windows OS 10 Windows Phone emulator is unable to verify that the machine is running. I Also experience this issue when running android simulators through Visual Studio Error: http://puu.sh/rYSHI/1f87937cb1.png [https://i.stack.imgur.com/lLVS8.png] > Error for running android: Could not launch "VS Emulator 7" Kitkat (4.4) XHDPI > Tablet device. Exit code 10. [...] read more
> System.ObjectDisposedException HResult=0x80131622 Message=Cannot access a > disposed object. Object name: 'SQLiteConnection'. > Source=System.Data.SQLite I've written a simple repository that uses Dapper and DapperExtensions When trying to retrieve some results, I get this error when using a Usingblock after the method returns to the view model. When replacing the Using [...] read more
I am uploading a text file and writing each split line to a database. The file has over a million lines. The upload and saving to the database works but breaks after the save on the await _context.SaveChangesAsync(); line with the following error > System.ObjectDisposedException HResult=0x80131622 Message=Cannot access a > [...] read more
UPDATE 1 I found out that if I reverse the order of my close/dispose then I get the error from dispose instead of close... so probably disposable protection means the method is only invoked once. I've been able to replicate the error on my device by creating a short to [...] read more
At the moment I am trying to get Roles configured using the RoleManager<Identity>, built into .NET Core 2.0, mvc-framework. However I am getting the following error: System.ObjectDisposedException HResult=0x80131622 Message=Cannot access a disposed object. A common cause of this error is disposing a context that was resolved from dependency injection and [...] read more
I receive a image file with Microsoft.AspNetCore.Http.IFormFile type in Controller. And I upload this file on Azure Blob. Before that I take a process like following Controller [HttpPost] public async void ActionMethod(IFormFile img) { // some process using(MemoryStream stream = new MemoryStream()) { // (1) img.CopyTo(stream); // (2) stream.Seek(0, SeekOrigin.Begin); [...] read more
I've a problem with a popup and print it to pdf silently. When I push print button (on the site), it's open a popup, generate a barcode and then popup prints. The popup contain two js functions window.print() and then window.close(). I need to print this popup silently to pdf, [...] read more
I'm trying to get the UserName of connected users for our application insights services but adding the custom telemetry to log UserName gives me a System.ObjectDisposedException occurred in mscorlib.dll but was not handled in user code error. Exception: Exception thrown: 'System.ObjectDisposedException' in mscorlib.dll An exception of type 'System.ObjectDisposedException' occurred in [...] read more
I trying to inject the ApplicationDbcontext into iLogger. When I use _context variable inside the CustomLoggerProvider or CustomLoggerExtension it'is work. While when the software CreateLogger create a instance of CustomLogger, I have a problem with ApplicationDbContext, when I use the _context variable to access the database the application crashes and [...] read more
My DbContext is being disposed at the first call to it from my application logic. I have a project that is structured like this. RootFolder ---DbContextProject //This is a .Net class library project ---ModelsProject //This is a .Net class library project ---InterfacesProject //This is a .Net class library project ---ApplicationLogicProject [...] read more
I need to create a user telegram in IDENTITY. But when using the method _userManager.CreateAsync(appUser), I get an error. Before that, I used IDENTITY only in the controller, from the data coming in the form. Now, I need to create a user from the data that comes from telegrams. My [...] read more
I have set up my own context using (as I believe is correct): public void ConfigureServices(IServiceCollection services) { services.AddDbContextPool<JobTrackingContext>(options => options.UseNpgsql(connection)); services.AddScoped<IJobRepository, JobRepository>(); } Then I define my JobTrackingContext as follows: public JobTrackingContext(DbContextOptions<JobTrackingContext> options) : base(options) { public DbSet<Job> Jobs { get; set; } } Now I can define a [...] read more
In the code below, I simply try to do a BeginEdit(False) in a DataGridView. Occasionally, this fails with: System.ObjectDisposedException HResult=0x80131622 Message=Cannot access a disposed object. Object name: 'DataGridViewTextBoxEditingControl'. Source=System.Windows.Forms StackTrace: at System.Windows.Forms.Control.CreateHandle() at System.Windows.Forms.TextBoxBase.CreateHandle() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() (...) I've ensured that the cell is the current cell, that [...] read more
I have an action filter which logs the request in a database. I use the usual construction injector method. public ServerLogFilterAttribute(OrderEntryContext context) { this.context = context; } public override void OnActionExecuting(ActionExecutingContext context) { var descriptor = context.ActionDescriptor; if (descriptor != null && descriptor.RouteValues.Count > 0) { var actionName = descriptor.RouteValues["action"]; [...] read more
Problem The most reproducible scenario is starting the desktop application from a link on the tray application and then requesting the desktop application via a callback to do something. That virtually always throws a timeout error as other subsequent errors. WCF Environment: Server: A System Tray applet Client: WinForms desktop [...] read more
SETUP Entity framework core 1.1 WPF application .NET 4.5.2 THE PROBLEM: I am sometimes encountering this exception while running a query on a sqlite database. > System.ObjectDisposedException occurred HResult=0x80131622 > Message=Safe handle has been closed Source=mscorlib StackTrace: > at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success) > at System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, > Boolean& success) at > [...] read more
I am saving a Todo model to database using EF Core in ASP.NET Core app. But when I try to print the success message using Console.Writeline it throws System.ObjectDisposedException Here's full application github code link Here's ToDo model: public class Todo { public int Id { get; set; } [Required] [...] read more