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.
Related
Using visual studio with class application I added the NLua via NuGet.
I want to read in and .lua file (BTW, of there is a better way do let me know)
My code is this:
...
using NLua;
...
using (Lua lua = new Lua())...
But when I run it I get an exception on the above line:
System.BadImageFormatException
HResult=0x8007000B
Message=An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Source=KeraLua
StackTrace:
at KeraLua.NativeMethods.luaL_newstate()
at NLua.Lua..ctor()
What am I doing wrong? I tried to search the internet and came up with solutions that it is since I am running a 64bit app while the one I am trying to load (NLUA) in 32bit.
Is that it?
THANK YOU
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.
i'm trying to create jpg files from html using NReco.ImageGenerator nuget.
i'm using function 'GenerateImageFromFile', in most cases the generation works fine, in other cases the dll throws me:
'An unhandled exception of type 'System.Exception' occurred in NReco.ImageGenerator.dll
Additional information: Image generation failed: Exit with code 1 due to network error: ContentNotFoundError'
i'll be glad to hear your opinion, any solution will be appreciated.
Thanks guys.
NReco uses an open source program called "wkhtmltopdf" (you can find it on https://github.com/wkhtmltopdf/wkhtmltopdf).
After run your application the .dll puts the "wkhtmltoimage.exe" in the path, in my case when I run the "wkhtmltoimage.exe" it asks for a .dll, in the majority of the cases you just need install the Visual C++ redistributable package (http://www.microsoft.com/en-us/download/confirmation.aspx?id=40784)
Since ImageGenerator is a .net wrapper for wkhtmltoimage you can apply the following command line option to ignore content load errors:
var htmlToImage = new NReco.ImageGenerator.HtmlToImageConverter();
var htmlToImage.CustomArgs = " --load-error-handling ignore ";
With this option wkhtmltoimage will ignore errors when referenced resource (js,css,images etc) cannot be downloaded.
Ederson's answer about VC++ runtime libs is correct for case if ImageGenerator throws an exception for any input (error message is "The pipe has been ended" or "Image generation failed: (exit code: 255)").
I use VS 2012 to do this tesseract code project.
I created WPF(C# project) import tesseractengine3.dll set using tesseract;
and created variable:
TesseractProcessor test = new TesseractProcessor() ;
and then compile the code in debug mode (x86 , with target .net 4)
It shows Error message dialog
"An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: 'The invocation of the constructor on type 'Recog.OcrTest' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'."
I searched on tesseractdotnet blog, and also google a lot of website and found nothing.
PS. I can run this code succesfully on VS2008. But when I code in VS2012 is occured error.
I cannot do my project in VS2008 because I have to some code of kinect which cannot work with VS2008.
Please anyone guide my how to solve this problem. I stuck with this problem for 1 week.
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