I have a .NET Core xUnit project. I'm trying to call a WCF service from it but get the following exception: System.InvalidOperationException occurred HResult=0x80131509 Message=An error occurred while loading attribute 'ServiceContractAttribute' on type 'IMyContract'. Please see InnerException for more details. Inner Exception 1: FileNotFoundException: Could not load file or assembly [...] read more
When I open Visual Studio 2013 and load my solution I'm greeted by an error message telling me the Test Window is unable to load. The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information. 1) Cannot compose part [...] read more
I'm trying to add identity server authentication to a .NET Core 3 API project. I've added this code public void ConfigureServices(IServiceCollection services) { … var identityBuilder = services.AddIdentityServer(); identityBuilder.AddApiAuthorization<ApplicationUser, DbContext>(); services .AddAuthentication() .AddIdentityServerJwt(); var fileName = Path.Combine("Certificates", "certificatefile.pfx"); var cert = new X509Certificate2(fileName, "veryDifficultPassword"); identityBuilder.AddSigningCredential(cert); … } And: public void [...] read more
I am using ASP.NET Core 3, .NET Core 3.0.100, Visual Studio 2019 Community. I follow this guide https://docs.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-3.0?view=aspnetcore-3.0#health-checks In Startup.cs, I add endpoints.MapHealthChecks("/health"); public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want [...] read more
Summary .NET Core apps fail to XML serialize an object which contains an enum value, while .NET Framework (4.7.2) succeeds. Is this a known breaking change, and if so, how can I work around it? Code Example The following console application does not throw an exception in .NET Framework 4.7.2 [...] read more
I'm trying to install SQL Server 2017 unattended into a Windows 10 Azure virtual machine, via chocolatey using the following command on a remote powershell session: choco install sql-server-express -ia ""/IACCEPTSQLSERVERLICENSETERMS /FEATURES=SQLEngine /Q /ACTION=install /INSTANCEID=[INSTANCE_NAME] /INSTANCENAME=SQLCHEMETER /FILESTREAMLEVEL=1 /SECURITYMODE=SQL /SAPWD=[SA_PASSWORD] /UPDATEENABLED=FALSE"" -o -y" But the installation fails and the log file [...] read more
I have a .NET Console App integrated with Entity Framework and Discord Sharp Plus with the following libraries: * DSharpPlus * DSharpPlus.CommandsNext * Microsoft.EntityFrameworkCore.Design * Microsoft.EntityFrameworkCore.Sqlite * Microsoft.EntityFrameworkCore.Tools Running the application without debugging (Control + F5 in Visual Studio) works just fine, no crashes issued. However, if I run with [...] read more
I have a v.2 Service Bus Trigger function which, when I attempt to start, throws the following exception: System.InvalidOperationException HResult=0x80131509 Message=The host has not yet started. Source=Microsoft.Azure.WebJobs.Host StackTrace: at Microsoft.Azure.WebJobs.JobHost.StopAsync() in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\JobHost.cs:line 121 at Microsoft.Azure.WebJobs.Hosting.JobHostService.StopAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Hosting\JobHostService.cs:line 32 at Microsoft.Extensions.Hosting.Internal.Host.<StopAsync>d__10.MoveNext() I've searched around but cannot find anyone with a [...] read more
I have created a ASP.NET Core 3.0 application using the React template configured with individual accounts login. I have since then upgraded it to version 3.1 and everything compiles and builds. However, at runtime I get the following error in the default controller namely OidcConfigurationController: System.InvalidOperationException HResult=0x80131509 Message=Client 'MyApp' not [...] read more
I'm trying to post to a local bitcoin full node via json-rpc but I'm getting an error from the server. Following the documentation here: https://bitcoincore.org/en/doc/0.17.0/rpc/rawtransactions/createrawtransaction/ I can see the following example structure for a createrawtransaction request: {"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"address\":0.01}]"] } My code creates the following [...] read more
I'm trying to build a console app, using .NET CORE 3.1, and I'm having a problem injecting a console logger. It looks like the way that logging is injected has changed significantly, in recent versions, and none of the various flavors of instructional tutorials seem to match what I'm trying [...] read more
I follow this tutorial: https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-3.1&tabs=windows#access-a-secret To a .NET Core 3.1 project I've added Microsoft.Extensions.Configuration.UserSecrets package, I have clicked on the project to manage secrets, the file has been created in the AppData directory and the UserSecretsId has been added automatically in .csproj file. Because the Host.CreateDefaultBuilder didn't load secrets I [...] read more
MyChromeDriver My Google Chrome version: 88.0.4324.150 I found some solutions but the don't worked for me. I want to open Google Chrome throw the Selenium, but it don't work yet. Error System.InvalidOperationException HResult=0x80131509 Message=session not created: This version of ChromeDriver only supports Chrome version 85 (SessionNotCreated) Source=WebDriver StackTrace: at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response [...] read more
I'm trying to customize IdentityUser using ApplicationUser, I followed the steps in microsoft article, but when I run the application, I get this error on method base.OnModelCreating(modelBuilder);: > System.InvalidOperationException HResult=0x80131509 Message=A key cannot be > configured on 'ApplicationUser' because it is a derived type. The key must be > configured [...] read more
I have a problem. After SP1 update, passing some time, VS 2012 becomes very-very slow when typing text. Solution size is not big, PC is quite powerful, it has 16GB of RAM, SSD drive, and i7-2600. I have attached using another VS and I see in debugger a lot of [...] read more
I'm developing a server-side application using Fluxor and the project now includes six Actions with a corresponding number of Reducers and Effects. At completion I expect there will be 20+ Actions with associated Reducers and Effects. Fluxor's state management is working well but as I build out the project I've [...] read more
WebView2 Control: As shown below, the HTML String successfully loads via NavigateToString(...) call inside Button_Click(...) event. But I need to have the HTML string loaded as soon as the Window and/or its Grid is loaded. But the following code either inside the constructor MainWindow(){...} or inside rootGrid_Loadded(...) event throws the [...] read more
I have seen this questions many times, but none of the answers works for me. My DotNet Core app fails The code: public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } the error: System.InvalidOperationException HResult=0x80131509 Message=Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could [...] read more
The C# / Entity Framework problem: I have object Account { public string AccountId { get; set; } public string UserId { get; set; } public string CurrencyId { get; set; } } then I need to return all accounts on "user A" which have same currencyId as accounts for [...] read more
I'm facing issues with registering a service with Autofac in a Blazor application. Deep in a dependency I have a UserService which needs access to the current ClaimsPrincipal. I've wrapped that with IPrincipalProvider to avoid registering the ClaimsPrincipal directly. My issue stems from the fact that in Core the current [...] read more
In my ASP.NET Core Web API, I add the DbContext to services: services.AddDbContext<OpContext>(options => options.UseSqlServer(Configuration["DatabaseConnectionString"])); The problem is that my dbcontext as three constructors: public partial class UppContext : DbContext { public UppContext() : base() { } public UppContext(DbContextOptions<DbContext> options) : base(options) { } public UppContext(IIdentificationService idService) : base() { [...] read more
I just installed the google translate api but when I try to use it within visual studios it gives me this error; ` > System.InvalidOperationException HResult=0x80131509 Message=The Application > Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be [...] read more
I am trying to query the mongodb database using AsQueryable and LINQ functions. My current database structure is that I have some collections, mainly a record which are defined in C# like this: public class Record { [BsonElement("formName")] public string FormName { get; set; } [BsonElement("created")] public DateTime Created { [...] read more
I am calling external Web API in my own Web API using ServiceStack. For the unsubscribed user, external web API throws expected "404 Not found" exception with the custom message as "No subscriber with uuid: {...uuid sent}". I can see it in Postman enter image description here [https://i.stack.imgur.com/Xl7hp.png] but when [...] read more
Summary In my Razor page, a single user action fires off two events. These events result in calls to the EF which result in the error: > System.InvalidOperationException HResult=0x80131509 Message=A second operation > started on this context before a previous operation completed. This is usually > caused by different threads [...] read more
I am trying to use Simple Injector as the DI container for Caliburn.Micro. Demo source: https://github.com/nvstrien/WPFDemos This project has a basic Caliburn.Micro setup with a Simple Injector Container. The ShellView has 1 button and when pressed, an async method is called to get some simulated data. I am getting this [...] read more
I recently updated the project code into .NET Core 3.1 and EF Core 3.1, now most of my linq queries brake, EX. public override ICollection<ContactDetailModel> GetAll(ICollection<int> ids) { return _context .Set<TEntity>() .IgnoreDeletedEntities() .Where(x => ids.Distinct().Contains(x.ContactId)) .Select(EntityToDTOMapper) .ToList(); } This code throws an error where I use Contains, I saw in [...] read more
I'm using azure cognitive search to index my data. I've upgraded to the latest Azure.Search.Documents (version 11) package. Previously I was using Microsoft.Azure.Search When I added CORS programmatically (Line No 5) I get the below error. Console.WriteLine("Creating Index..."); FieldBuilder fieldBuilder = new FieldBuilder(); var searchFields = fieldBuilder.Build(typeof(Hotel)); var searchIndex = [...] read more
I was using the lambda expression conversion class from How can I convert a lambda-expression between different (but compatible) models? class name "TypeConversionVisitor". It's working well with model queries. When am trying to convert the below it's throwing exceptions.The below is the exception. Exception: System.InvalidOperationException HResult=0x80131509 Message=The binary operator Equal [...] read more
In my Web App I am trying to update my Album. To do so, I have an OData Web API. I added the OData Web API service to my Web App using this tutorial. I am having a problem with calling the DataServiceContext.SaveChanges() after I called the DataServiceContext.UpdateObject. This is [...] read more
I have a WPF application that has started failing with the following error at start: System.InvalidOperationException: ''{DependencyProperty.UnsetValue}' is not a valid value for property 'BorderBrush'.' This exception was originally thrown at this call stack: [External Code] This is not very forthcoming about what has caused the error. I have tried [...] read more
I have implemented a ML model using keras in c#. The output is a 4dim vector. I have the following predict function to predict one entry. public (DateTime TimeStamp, double dim1, double dim2, double dim3, double dim4) Predict(ForecastControllPower input) => Predict(new List<ForecastControllPower>() { input }).First(); But I want to now [...] read more
I'm trying to post to a local bitcoin-qt via json-rpc but I'm getting error 500 from the server. Following the documentation here I tried this code but it's giving the error 500, it works fine with other methods like getblockcount or getnewaddress Private Sub Button1_Click(sender As Object, e As EventArgs) [...] read more
I am using Entity Framework Core 5.0.0-preview.6.20312.4, Microsoft SQL Server 2019. I catch error > The instance of entity type 'Profile' cannot be tracked because another > instance with the key value '{Id: 1087}' is already being tracked. When > attaching existing entities, ensure that only one entity instance with [...] read more
I am working on a POC and need some data. Decided to use the following as a template: https://stormpath.com/blog/tutorial-entity-framework-core-in-memory-database-asp-net-core Followed the example. Except at opt.UseInMemoerydatabase("Files"). without the name it shows error. This is my code. It throws System.InvalidOperationException HResult=0x80131509 Message=Cannot resolve scoped service 'DataAPI.Models.FileContext' from root provider. at var context [...] read more
I'm trying to use ASP.NET Core to read from a SQL database. I'm using Microsoft.EntityFrameworkCore.DbContext and I have it working except for any tables that have an XML column When try and read from one of these tables I get the following error: System.InvalidOperationException HResult=0x80131509 Message=The entity type 'SqlXml' requires [...] read more
I'm trying to learn Appium and using it for WPF application testing. Tests against Calculator or Notepad are running fine, but recently I've encountered a problem when trying to test custom WPF application. Appium desktop app tests throw "An element could not be located on the page using the given [...] read more
Using EF Core, no matter what I do, I am unable to get the lambda in the Where statement to correctly evaluate to SQL. I have a basic generic LINQ query that takes an argument of type T where T :class, ICommonModel, this translates via a Repository that returns a [...] read more
I am using Entity Framework code first with db migration for our Azure SQL Server. Recently I tried to use Azure Active Directory authentication using this article https://docs.microsoft.com/en-us/azure/sql-database/sql-database-aad-authentication-configure. I am passing SQL connection to Entity Framework that is constructed using application access token. Everything works as expected but DB migration. [...] read more
Thank you for answering the question. I check whether the variables contains null, however it's not the cause of null. Today, I find out why can not work. Because, the variable I set at variable mapping is as same as collection one too. So first loop works but next loop [...] read more
I'm trying to use 'Always Encrypted' for ID client column in my table. Creating it in the SQL server was so easy. I tried to query in SSMS by activating in "Additional Connection Parameters" and type Column Encryption Setting=enabled. Run simple query and it works. But I get errors in [...] read more
> Prefix: Unfortunately, rewriting these Classic ASP pages into ASP.NET is not > an option. This is a complex legacy application that we're maintaining. I'm having trouble getting an HttpWebRequest to POST to a Classic ASP page within the same web application. The page works quickly and correctly in a [...] read more
I'm trying to write this controller that accepts a POST request. I need this controller to add a new book, and also add that new books bookId to another object called a StoreList. So I am trying to pass in the new bookList, and the storeList that needs the bookId [...] read more
When I scaffold this Oracle DB (database -first) and it generates me all models, contexts, FK relations ect. But it gives me an error in the context when I start Querying. (simple things as select * from (any Table)) > The follow error comes up. > > System.InvalidOperationException > > [...] read more
I've recently updated to the latest .net core 3.0 SDK, updated all my nugets to also include pre-release versions, however I keep getting this error come up when I try to do anything with Pomeolo / Entity Framework with MySQL. System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=2.2.0.0, Culture=neutral, [...] read more
PROBLEM STATEMENT Trying to connect RavenDB Cloud service using AWS Lambda function, for one of my POC, but failed to connect. BACKGROUND I am using the client certificate (.pfx) file for this. It throws error exactly during certificate assign with X509Certificate2. I have converted the certificate to byte[] and passed. [...] read more
UPDATED QUESTION: I have an Asus PC, Windows 8.1 OEM. It was for someone who absolutely needed a start menu, so I jumped on the Win10TP when it first came out about a month after we got the PC. I believe I used the key provided by microsoft to get [...] read more
I have the goal of being able to programmatically update OneNote page data using C#. The Microsoft Graph API reference documentation suggests this can only be done by page element, not by page, and gives the following C# Graph SDK example: GraphServiceClient graphClient = new GraphServiceClient( authProvider ); var stream [...] read more
Please I need your help to solve FluentValidation issue. I have an old desktop application which I wrote a few years ago. I used FluentValidation Ver 4 and Now I'm trying to upgrade this application to use .Net framework 4.8 and FluentValidation Ver 10, but unfortunately, I couldn't continue because [...] read more
Starting out with EF Core, I'm trying to use an abstract class. I understand that I can't instantiate an abstract class and have a part of code missing but cannot find how to solve it. The code is as follows: using System; using Microsoft.EntityFrameworkCore; using System.ComponentModel.DataAnnotations; using Microsoft.Extensions.Logging; namespace ProjectTest1 [...] read more
I am new to Blazor and trying to run Javascript runtime in Blazor Webassembly (using ABP framework) to store in the local storage, but for some reason I am getting UnsupportedJavaScriptRuntime Error. I tried the same in Blazor server side and it worked. private async Task < Order > GetOrder() [...] read more
I am attempting to append an HTML page into a DocM file, and have the entire content hidden. As I understand, I need to use the Vanish class (https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.vanish?view=openxml-2.8.1) to achieve this. I streamed the HTML content into an AltChunk using the code provided here: https://stackoverflow.com/a/18152334/1243462 . I then try [...] read more
I am working with an XML document supplied by a vendor that I used XSD to convert to a serializable object. Here is the template xml they provide. <?xml version="1.0" encoding="UTF-8"?> <doi_batch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.crossref.org/schema/4.4.2 https://www.crossref.org/schemas/crossref4.4.2.xsd" xmlns="http://www.crossref.org/schema/4.4.2" xmlns:jats="http://www.ncbi.nlm.nih.gov/JATS1" xmlns:fr="http://www.crossref.org/fundref.xsd" version="4.4.2"> <head> <doi_batch_id>arg_123_954</doi_batch_id> <timestamp>20190430133609</timestamp> <depositor> <depositor_name>Crossref</depositor_name> <email_address>pfeeney@crossref.org</email_address> </depositor> <registrant>Society of Metadata Idealists</registrant> [...] read more
As per Microsoft's Getting Started with webView2 in Windows Forms (as of 2021 March 9), I've got the following code (with webView2.source not set; edited out of Form.Designer.cs): public Form1() { InitializeComponent(); InitializeAsync(); } async void InitializeAsync() { Console.WriteLine("InitializeAsync starting"); await webView2.EnsureCoreWebView2Async(null); Console.WriteLine("InitializeAsync done"); } private void Form1_Load(object sender, EventArgs [...] read more
Given the following classes that models a TPT inheritance using EF Core 5: public abstract class Entity { public int Id { get; set; } public int PartitionId { get; set; } public Company Company { get; set; } } public class Employee : Entity { } public class Company [...] read more
I'm generating a C# solution using another project. The generated solution contains multiple classes and a unit test file for each class. A unit test creates two instances of a class and compares them. For the comparison, I chose FluentAssertion (I tried other external comparators like ComareNetObjects, but it took [...] read more
I had created an MVC application that had no authentication so I was advised to create a mvc project that has the 'Individual User Accounts' option selected which brings with it some controllers, models and views. What I had done to keep my old class library data was rename the [...] read more
EDIT 3 I have used the provided links to change the connection, which works :) now I have this message for every record pulled from my database Error Screen EDIT 2: No reason for ODBC, just it was the first result, code is below I am running VS Studio 2017 [...] read more
i have this code in my library Entrega.cs [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } public string NumeroDeEnvio { get; set; } public int MotivoId { get; set; } public int SubmotivoId { get; set; } public string SucursalId { get; set; } public string CodigoComprobante { get; [...] read more
I want to register class Foo and its interface IBar. var b = new DbContextOptionsBuilder(); b.UseSqlServer(@"Server=(localdb)\MSSQLLocalDB;Database=Connect.Device;Trusted_Connection = True; MultipleActiveResultSets = true;"); _container.Register(() => new DeviceContext(b.Options), Lifestyle.Scoped); _container.Register<IFoo, DeviceContext>(Lifestyle.Scoped); _container.Register<IDeviceTypeService, DeviceTypeService>(Lifestyle.Scoped); This does not work. This is the exception which is thrown on call to Verify: > System.InvalidOperationException HResult=0x80131509 Message=The configuration [...] read more
There is an extension method that registers IAccountSearchServiceClient with some policy handlers looks like Polly lib is used public static IServiceCollection AddAccountSearchServiceClient(this IServiceCollection services) { services.AddHttpClient<AccountSearchServiceClient>() .ConfigureHttpClient((sp, client) => { var options = sp.GetRequiredService<IOptions<AccountSearchSettings>>(); var settings = options.Value; client.BaseAddress = settings.BaseUrl; }) .ConfigurePrimaryHttpMessageHandler(() => { var handler = new HttpClientHandler [...] read more
I implemented a simple Delete method in my ServiceStack Service class as follows... public void Delete(DeleteCompany d) { Company c = new Company(); c = ctx.Companies.AsNoTracking().FirstOrDefault(m => m.id == d.id); if (c == null) { return; } ctx.Companies.Remove(c); ctx.SaveChanges(); } ctx is populated via Dependency Injection. This works great the [...] read more
Here is a new issue. Trying to update entry in the Database. Note, this entry has dependency on User. I conducted the same logic I used to do when I didn't have user association with the item without any issue. However, now it is giving me grief. Here is the [...] read more
I have tried every variation of this query in EF Core and I cannot figure it out. I have simplified this as such: Invoice Table InvoiceId stuff 1 A 2 B InvoiceLog Table Id InvoiceId Date PersonId 1 1 11/12/2015 1 2 2 1/20/2018 2 3 2 3/15/2019 3 Person [...] read more
I need to populate a Sqlite table with precalcutated values. Only one table with currently ~20 rows. After fiddling around a day or two I managed to got the approach 1 working with bulk inserts which works great for "smaller amounts of entries" (5_000_000 records) and it's quite fast. Unfortunately [...] read more
I'm using Entity framework core 3.1 to connect to the database, what I'm trying is to get the Highest and lowest product details which grouped by its category id. based on answers shown on this question and this question I tried to write the following code: using Linq : //NOTE: [...] read more
I'm developing a C#/WPF Application running lengthy data Uploads to a server. For this, I launch a dialog window, which launches a backgroundWorker thread. The worker thread processes the file uploads. The UI Updates are done with Application.Dispatcher.BeginInvoke() calls. The file uploads use HttpClient, calling Task.Run() for the async part. [...] read more
I'm in the process of updating an Asp.Net Core 2.2 application to 3.1. We use Microsoft.Identity.Web to handle Azure AD authentication. I changed our security configuration as as follow: ConfigureSerivces services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddMicrosoftIdentityWebApi(configuration) .EnableTokenAcquisitionToCallDownstreamApi() .AddInMemoryTokenCaches(); services.AddAuthentication() .AddScheme<ApiKeyAuthenticationSchemeOptions, ApiKeyAuthenticationHandler (AuthenticationSchemes.ApiKey, null); And Configure app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseMiddleware<LogUsernameMiddleware>(); app.UseEndpoints(p => { p.MapControllers(); }); [...] read more
I'm trying to migrate my project from asp.net core 3.0 to 3.1 and I have found one issue: public static bool CheckConnection(this DataContext dataContext) { try { return dataContext.Database.CanConnect(); } catch(SqlException) { return false; } } this code worked in version 3.0, but when I have migrated I got this [...] read more
I have the following method within my API controller in an AngularJS WebAPI/MVC project: [Route("GetRecordByID/{metricID:string}")] [ResponseType(typeof(Metric_Approval_Data))] [HttpGet] public Metric_Approval_Data GetRecordByID(string metricID) { Metric_Approval_Data arecord = null; try { arecord = dbContext.Metric_Approval_Data.Where(x => x.Metric_ID == metricID).SingleOrDefault(); } catch (Exception e) { arecord = null; } return arecord; } This method should [...] read more
Recently I tried downloading multiple pdf files in C# for a project I am working on. here's my code snippet: private static void GetPdf() { for (int i = 0; i <2; i++) { using (var client = new WebClient()) { client.Headers.Add("User-Agent: Other"); if (i == 0) { client.DownloadFile("https://files.geva.co.il/geva_website/uploads/2020/06/36371-2020.pdf", "ElectricityQ.pdf"); [...] read more
I have a problem with using EF "database-first" in Core 3.1 with many-to-many relationship. There are two tables: ResourcesAZEZ and AsezPoolFileStore And third table AsezPoolFileLink, which contains only two columns: idRes and idFile Auto-generated code of that classes: public partial class AsezPoolFileStore { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public AsezPoolFileStore() { this.ResourcesAZEZs = [...] read more
I'm trying to serialize data but a strange error occurs: System.InvalidOperationException HResult=0x80131509 Message=There was an error generating the XML document. Source=System.Xml StackTrace: at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) at System.Xml.Serialization.XmlSerializer.Serialize(Stream stream, Object o, XmlSerializerNamespaces namespaces) at System.Xml.Serialization.XmlSerializer.Serialize(Stream stream, Object o) at Starbreaker.Form1.Form1_FormClosing(Object sender, FormClosingEventArgs e) [...] read more
Is it possible to switch DisplayTemplate like below when we consume in different cshtml pages? Data1 and Data2 are two cshtml DisplayTemplates but referring same Data1 model. If we are using without template name, its working and taking the Data1 template. cshtml1. DisplayFor(m=>m.Data1List,"Data1") cshtml2. DisplayFor(m=>m.Data1List,"Data2") I have received error like [...] read more
I have 2 controllers using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using shadow.Data; using shadow.DTO; using shadow.Models; using shadow.Services; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; namespace shadow.Controllers { [Route("[controller]")] [ApiController] public class UserTrustedPersonController : ControllerBase { private IUserService _userService; [...] read more
I've read through the discussion at The calling thread cannot access this object because a different thread owns it but it's all about UI. I have two C# EXEs that are purely command-line, but are throwing this error as well. Perhaps the full exception message will help: System.InvalidOperationException HResult=0x80131509 Message=The [...] read more
I have enable-migration as well enablemigration=true. But i have table definition to save all form fields. Its keeps throwing this error. " System.InvalidOperationException HResult=0x80131509 Message=The model backing the 'eNtsaRegistration' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269)". What i want [...] read more
I generated the database from the model now I notice that all the tables have an "s" appended to then Userid object transloated to Userids in SQL. which nwhen I run the code Userid userid = db.Userids.Find(id); gives me this error: System.InvalidOperationException: 'The entity type Userid is not part of [...] read more
so the issue I'm having is when I try to run my automation tests with the Chrome Web browser, I get the following error message: System.InvalidOperationException HResult=0x80131509 Message=session not created: This version of ChromeDriver only supports Chrome version 80 (Driver info: chromedriver=80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987@{#882}),platform=Windows NT 10.0.17763 x86_64) (InsecureCertificate) Source=WebDriver StackTrace: at [...] read more
I created an EchoBot with the Bot Framework template, installed the bot framework 4.9, and then changed the target .Net version to Core 3.1. Now, I get the following error: System.InvalidOperationException HResult=0x80131509 Message=Endpoint Routing does not support 'IApplicationBuilder.UseMvc(...)'. To use 'IApplicationBuilder.UseMvc' set 'MvcOptions.EnableEndpointRouting = false' inside 'ConfigureServices(...). Source=Microsoft.AspNetCore.Mvc.Core How do [...] read more
I'm trying to get HTML from a URL so I can strip it down using Boilerpipe. However, I keep on getting an exception. I am using the NewsAPI to get my URLs. Here is the relevant code snippet: foreach (var article in articlesResponse.Articles) { string html; string url = article.Url; [...] read more
I wish to find the problem of this code which gives that the application is in break mode Exception unhandled. What can I try? > System.InvalidOperationException occurred HResult=0x80131509 Message=An error > occurred creating the form. See Exception.InnerException for details. The > error >> > is: Object reference not set to [...] read more
i am working with data that needs updated from a third party source. My problem is that i need to allow my program to automatically do this from an odbc connection. i get the error; it is a very large file but it will fit into a string. The sql [...] read more
I'm developing AWS Lambda project with .Net SDK (Core 2.1). I need to use iText7 in my project. When I want to debug the project throws below exception. System.IO.FileLoadException: Could not load file or assembly 'itext.kernel, Version=7.1.10.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca'. An operation is not legal in the current state. (Exception from [...] read more
I'm trying to download a file with a special character 'Ç' for example in the filename, I get an exception with that character in the URL string. System.Net.WebException HResult=0x80131509 Message=The remote server returned an error: (404) Not Found. Source=System.Net.Requests For example: http://www.somesite.com/abcdç.pdf would create an exception in the WebClient. What [...] read more
I have a Sqlite/C# Application and want to start a transaction but i always get this execption: > System.InvalidOperationException HResult=0x80131509 message= The operation is > invalid due to the current state of the object. > Quelle = System.Data.SQLite Stapelüberwachung: bei > System.Data.SQLite.SQLiteConnection.BeginDbTransaction(IsolationLevel > isolationLevel) bei > System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction() > bei CsvCompare.database.importCSVtoDB(List`1 [...] read more
I've been trying to debug this error, but am at a loss for what the cause is. From what I can tell through the stack trace, it is occurring when the PopMode action occurs. The exception occurs when I begin to walk the tree. If I remove the PopMode action [...] read more
I am getting an error when attempting to to remove the timestamp from a Map and was wondering if there were any way that this would be possible? AutoMap(); Map(m => m.BeginDate.Value.ToShortDateString()).Name("Delivery Begin Date").Index(0); I am getting the error: System.InvalidOperationException HResult=0x80131509 Message=No members were found in expression '{expression}'. Source=CsvHelper StackTrace: [...] read more
Moving over from .net Framework EF 6.4, did something similar for years. Just trying to use a Guid datatype with SQL Server db, getting this error - this should just work, right?? If I remove applyconfigurations in the DbContext.OnModelCreating then it works (must be using default). System.InvalidOperationException HResult=0x80131509 Message=The property [...] read more
i´ve got an WPF application with an "settings-winwow". if i´m clicking on "info" on the mainwindow, settings.showDialog(); is called - so far so good. It opens and i can do some stuff, bus when i´m closing it and try to open it again, it gives me an error. its called: [...] read more
I have a Windows Server 2016 VM and Visual Studio 2017 Community Edition. I am writing a simple script just to check the connectivity with the Sharepoint 2013. The Sharepoint Server is NOT installed on the VM, it is somewhere within the intranet. using System; using System.Collections.Generic; using System.Linq; using [...] read more
I can create a symmetrically signed jwt token using the HmacSha256 algorithm using this dot net core 2.2 code. using System; using System.Text; using Microsoft.IdentityModel.Tokens; using System.IdentityModel.Tokens.Jwt; namespace ConsoleApp1 { class Program { static void Main(string[] args) { var securityKey = "7iMdnuwf7XMMKGXGSMHKcs+qicGCinCJONLPrhGOX94="; var symmetricSecurityKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(securityKey)); var signingCredentials = [...] read more
Upon trying to run/debug code of a WindowsForm I run into the following exception: > System.InvalidOperationException HResult=0x80131509 Message=An error occurred > creating the form. See Exception.InnerException for details. The error is: > Object reference not set to an instance of an object. Source=Automated > SoundPower Testing StackTrace: at > Automated_SoundPower_Testing.My.MyProject.MyForms.Create__Instance__[T](T [...] read more
I have a SSIS Package , which runs fine in Visual studio. The package uses a for each file loop and the variable points to a folder like this: \\server\d$\foldername\subfolder\ When I deploy the package on SSMS, when I execute the package I get the following error: Error 1: FLC [...] read more
I had a class similar to this: public class Script { public string Name { get; set; } public string HomeKey { get; set; } = ""; } which would deserialize from an XML file like this: <Script> <Name>ScriptName</Name> <HomeKey>KeyText</HomeKey> </Script> This works fine using the following code: [Test] public [...] read more
This error drives me crazy. I have added an access DB to my project as a data source (to bind it with components in my form) and because of this not only that I am unable to connect to the database, but I am also unable to run the whole [...] read more
The result of my BackgroundWorker throws an InvalidOperationException in the RunWorkerCompletedEventHandler. It occurres on cancellation and complete. The events of the GUI occurres fine, the worker.processChange(...) works fine and the RunWorkerCompletedEventHandler (which is in the MainWindow.xaml.cs) works also fine. The cancelation of the Task.Delay(...).Wait() works fine too. MainWindow.xaml.cs: public partial [...] read more
Relatively new to C# threading and ran into a situation whereby an async call is made using cefsharp that scrapes a table from a site (using a headless call). That part works fine, however, I need to clear and repopulate a DataGridView on the main form, and get an error [...] read more
In my Application resources I have <Application.Resources> <Color x:Key="SMSBlue">#008CFF</Color> </Application.Resources> And somewhere in a control template in a Window I have <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter TargetName="Panel" Property="Background" Value="{StaticResource SMSBlue}"/> <Setter TargetName="Header" Property="Foreground" Value="White"/> </Trigger> <Trigger Property="TabIndex" Value="0"> <Setter TargetName="Header" Property="Foreground" Value="Red"/> </Trigger> </ControlTemplate.Triggers> The window renders fine in the [...] read more
I have a Linq statement as below if (!inspectionItemIds.Contains((int)item.InspectionItemId)) { inspectionItemIds.Add((int)item.InspectionItemId); } And item.InspectionItemId is coming as null and its throwing me exception as below: System.InvalidOperationException HResult=0x80131509 Message=Nullable object must have a value. Source=mscorlib StackTrace: at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Nullable`1.get_Value() at IMS.Model.DomainLogic.ViolationManager.<>c__DisplayClass19_0.<ViolationsFor>b__9(Violation item) in C:\SourceCode\IMS\Development\IMS\IMS.Model\DomainLogic\ViolationManager.cs:line 254 at System.Collections.Generic.List`1.ForEach(Action`1 action) at [...] read more
I am trying to run a vb script using ssh hook in airflow. When I try to run the same cscript vb script command on windows command prompt it works fine. but when i try to run it from airflow which is doing ssh to same windows machine I get [...] read more
EDIT I removed my code as it was incomplete and confusing, but added a minimal reproducible exemple. All the text below has been slightly rewritten to clarify my question, adding information from the comment, but without adding anything I didn't know when asking the question, in order to keep the [...] read more