Why some or all identity references could not be translated - c#

In the visual studio 2010, there is no error and everything works fine, but when I publish to IIS once an error
line:
Microsoft.Expression.Encoder.Preset pres = Microsoft.Expression.Encoder.Presets.VC1IISSmoothStreamingSD480pVBR;
error:
Server Error in '/' Application.
some or all identity references could not be translated
Description: An unhandled exception occurred during the execution of the current web request. Examine the stack trace for more information about this error and where it originated in the code.
Exception Details: System.Security.Principal.IdentityNotMappedException: some or all identity references could not be translated.
update:
I'm getting the same error from line:
var job = new Job();
namespace:
using System;
using System.Linq;
using System.Web.Mvc;
using Microsoft.Expression.Encoder;
using Microsoft.Expression.Encoder.Profiles;
using VideoSmooth.Domain.Abstract;
using VideoSmooth.Domain.Entities;
using VideoSmooth.Web.Models;

I set ApplicationPoolIdentity in pool iis and it worked without error

Related

C# Generate SSRS Reports "reportservice2005 exception"

I have created a console application before that renders a report, and saves it as a pdf. I am now creating a new one following similar guidelines. When I try to run the program I get this exception:
An unhandled exception of type 'System.ArgumentNullException' occurred in System.dll
Additional information: Value cannot be null.
on this line of code:
ReportingService2005 rs = new ReportingService2005();
I am currently using these references, which are the same as in my other console app as well:
using pdfGeneration.severRef;
using pdfGeneration.ssrsExRef;
using System;
using Microsoft.Reporting.WinForms;
using System.Data.SqlClient;
If anyone knows how to solve this or why this is happening let me know! I am a bit confused as to why it is saying this value is null..
Using visual studio 2015
Thanks!
Update: There was an issue with the reference paths, I deleted them and reinstalled.

MixERP database configuration error

I have cloned the project from github and followed instructions from the MixERP documentation. Built the project in visual studio successfully, installed PostgreSQL version 9.6.
When I ran the project it gave me error
relation config.mixerp not exist
We are using VS2015, PgAdmin4.
ERROR: 42P01: relation "config.mixerp" does not exist
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Npgsql.NpgsqlException: ERROR: 42P01: relation "config.mixerp" does not exist
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
I was running the same version of VS and pgAdmin. I noticed that running the db scripts does not create any tables or views in the database. My suspicion is that mixerp is not completely compatible with PostgreSQL 9.6 as yet. Looking at the DbServer.config, PostgreSQL 9.4 was used during development.
A downgrade of PostgreSQL to v9.4 will resolve the issue you are experiencing. I suggest completely uninstalling PostgreSQL 9.6 and installing PostgreSQL 9.4 instead and thereafter follow the setup document again.

Selenium - Visual Studios- C# - All (chrome, firefox, and internet explorer) webdrivers unable to start driver service

I'm trying to set up Selenium for testing and none of my webdrivers seem to work. I have tried moving them around in the project folder and the only way I can get Visual Studios to locate them is with a #"path" statement.
The real problem is... Once Visual Studio locates the webdriver, the operation times out and I get the following exception:
An unhandled exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll
Additional information: Cannot start the driver service on http://localhost:(random port number that changes every time)
I have tried restarting my computer and having the system administrator check the firewall and malware blocker logs, but neither seems to have helped (or they don't know the correct thing to look for).
I figure this is something super simple and I'm just missing it... Any help would be greatly appreciated.
Here is a copy of my code:
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.IE;
namespace SeleniumWork
{
class Program
{
static void Main(string[] args)
{
IWebDriver driver = new InternetExplorerDriver(#"C:\blahblahpathstring");
driver.Navigate().GoToUrl("http://www.google.com/");
IWebElement query = driver.FindElement(By.Name("q"));
query.SendKeys("Cheese");
query.Submit();
var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
wait.Until(d => d.Title.StartsWith("cheese", StringComparison.OrdinalIgnoreCase));
Console.WriteLine("Page title is: " + driver.Title);
}
}
}
Here is a copy of the debug output I receive:
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll
I have had the same problem on my work machine, but not on my personal machine. The only difference I could attribute between the two was that I was using VS 2015 at home and VS 2017 at work.
What fixed it was I used the NuGet Package Manager for the project and downloaded the Selenium.Firefox.WebDriver by jbaranda, which uses the new marionette based web driver rather than gecko driver.
With this installed I was able to get a firefox browser up and running without any extra configuration or options:
IWebDriver driver = new FirefoxDriver();
driver.Url = "www.google.com";
Whereas before it would throw the 'Cannot start the driver service...' exception you mentioned. There are NuGet packages for other browsers which I suggest for the particular one you're using, but the only one I didn't have that issue with was IE. Hope that helps
I had the same issue, and had had no idea how to fix it. In the end I found out that the Firewall blocked the traffic to loopback. The firewall installed on the machine is McAffe.
All I did was stopping the service which manages traffic scan.
Hope it will help you.
I've been hitting this consistently on IEDriverServer and rarely on FireFox.
Fixed it twice when it happened on FireFox - first time I updated the gecko driver, second time I restarted my PC. Something in the environment's going on, maybe the driver does not fully quit sometimes, so new instantiations are being blocked?
I think mostly beginners face this problem when they are running Selenium with C# for the first time.
As i also faced this situation. As highlighted in one of the answer and let me show with images
You have installed Selenium.webDriver but you have not installed Selenium.Firefox.WebDriver
Step 1 :- Go to Nugget Manager
Step 2 :- Select Selenium.Firefox.WebDriver and install it
Now run the program once again and that problem will go away.

Parse error in ASP.NET web forms application

Four time in four days in four different projects I have received the following error (except different for project name). The projects all work fine while I am building the first couple of forms and then I go to lunch, go home overnight, etc. and then suddenly they throw this error. This last time, all I did was walk away for five minutes to take a leak.
How do I fix and prevent this? I am very new to ASP.NET, so don't know much on how to fix errors of this sort.
Parser Error
Description: An error occurred during the parsing of a resource
required to service this request. Please review the following specific
parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'PathCertLink.Global'.
Source Error:
Line 1: <%# Application Codebehind="Global.asax.cs"
Inherits="PathCertLink.Global" Language="C#" %>
Source File: /global.asax Line: 1
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.6.1055.0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Optimization;
using System.Web.Routing;
using System.Web.Security;
using System.Web.SessionState;
using System.Data.Entity;
using PathCertLink.Models;
using PathCertLink.Logic;
namespace PathCertLink
{
public class Global : HttpApplication
{
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
// Initialize the database.
Database.SetInitializer(new ProductDatabaseInitializer());
// Create the custom role and user.
RoleActions roleActions = new RoleActions();
roleActions.AddUserAndRole();
}
}
}

multiple active result set(MARS) on Appharbor how to enable?

this is my first question at stackoverflow, so bear with me.
In my local project I use ASP.NET MVC 3 and Entity Framework 4.3 with SQL Express.
in my connection string i have MARS set to true;
but when i am deploying my project on to Appharbor, Appharbor injects its own connection string,
where MARS is not set in the connectionstring. So i get this:
There is already an open DataReader associated with this Command which must be closed first.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.
So far best solution i have seen on this: http://support.appharbor.com/kb/add-ons/using-sequelizer
where they have this code:
var configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
var connectionString = configuration.ConnectionStrings.ConnectionStrings["ConnectionstringAlias"].ConnectionString;
if (!connectionString.Contains("MultipleActiveResultSets=True;"))
{
connectionString += "MultipleActiveResultSets=True;";
}
configuration.ConnectionStrings.ConnectionStrings["ConnectionstringAlias"].ConnectionString = connectionString;
configuration.Save();
I can not figure out where to place this, have tried to put it in global under
Aplication_Start() method
But that gives me this error:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 50:
Line 51: var configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
Line 52: var connectionString = configuration.ConnectionStrings.ConnectionStrings["ConnectionstringAlias"].ConnectionString;
Line 53: if (!connectionString.Contains("MultipleActiveResultSets=True;"))
Line 54: {
Source File: C:\Users\William\Documents\Visual Studio 2010\Projects\xxx\xxx\Global.asax.cs Line: 52
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Educationexpander.MvcApplication.Application_Start() in C:\Users\William\Documents\Visual Studio 2010\Projects\xxx\xxx\Global.asax.cs:52
Is there anyone out there with a solution to this problem ?
Update: Multiple Active Result Sets (MARS) can now be enabled for the injected connection string by using the Sequelizer admin panel. This is the recommended approach since the web.config no longer needs to be modified, which causes an AppDomain reload during startup
Answer is in the above comments, this is just to formalise.
You need to use the correct ConnectionstringAlias (thanks #chris-sainty) and you have to enable file system writes in application settings for the updated configuration to be written to disk.

Categories

Resources