草庐IT

PdfViewer-FileNotFoundException

全部标签

c# - Newtonsoft.JSON v9.01 + FileNotFoundException(.NET 核心类库)

(VS2015更新3+补丁)我有一个普通的.NET控制台应用程序(.NET4.6)并引用了一个面向NetStandardv1.3的.NET核心类库。类库引用了Newtonsoft.JSON。{"version":"1.0.0-*","dependencies":{"NETStandard.Library":"1.6.0","Newtonsoft.Json":"9.0.1"},"buildOptions":{"platform":"anycpu"},"frameworks":{"netstandard1.3":{"imports":"dnxcore50"}}}引用的NewtonSoft.

c# - mscorlib.XmlSerializers.DLL 的 FileNotFoundException,它不存在

我正在使用XmlSerializer反序列化mscorelib.dll中的特定类型XmlSerializerser=newXmlSerializer(typeof([.NettypeinSystem]));return([.NettypeinSystem])ser.Deserialize(newStringReader(xmlValue));这会在加载程序集时引发捕获的FileNotFoundException:"Couldnotloadfileorassembly'mscorlib.XmlSerializers,Version=2.0.0.0,Culture=neutral,Publ

c# - 依赖项目之间的依赖关系不流动,导致 System.IO.FileNotFoundException

假设我的解决方案有2个项目:第一个称为“MainProject”(一个.NETStandard2.0项目)。第二个称为“MainProjectTests”(一个NUnit测试项目),每个类的一些单元测试都放入“MainProject”。第一个项目(MainProject)有一个名为“dependencyX”的NuGet依赖项。显然,项目“MainProjectTests”引用了“MainProject”。因此,当测试运行器运行“MainProjectTests”测试时,使用“dependencyX”从“MainProject”调用方法时,我得到了一个System.IO.FileNotF

java - 作为 jar 运行时出现 FileNotFoundException

FileInputStreamfstream=newFileInputStream("abc.txt")在作为jar运行时抛出FileNotFoundExceptionn。为什么?通常它能够在从main方法运行时找到。 最佳答案 classMyClass{InputStreamfstream=this.getClass().getResourceAsStream("abc.txt");}应该使用此代码。并且文件(在本例中为abc.txt)应保存在对象引用类位置。这意味着,this.getClass指的是某个文件夹的位置,即com/m

JAVA + try catch(FileNotFoundException e) 进入 catch(Exception e)?

我有一些命令可以在磁盘上创建一个文件。因为必须在其中创建文件的文件夹是动态的,所以我有一个问题(FileNotFoundExceptione)。在同一个tryblock中,我已经有了一个catch(Exceptione)block。出于某种原因,当我运行我的代码并且该文件夹尚不存在时,将使用catch(Exceptione)block,而不是FileNotFoundExceptionblock。虽然调试器很清楚(至少对我而言),但显示了FileNotFoundException:java.io.FileNotFoundException:c:\mydata\2F8890C2-13B9-

java - 为什么 FileWriter 不创建新文件? FileNotFoundException异常

这个问题在这里已经有了答案:WhyFileWriterdoesn'tcreateanewfile?(1个回答)关闭8年前。所以我有一个代码片段如下。我试图找出它抛出FileNotFoundException的原因。Filefile=newFile(WORKSPACE_PATH+fname);FileWriterfw;if(file.exists()){fw=newFileWriter(file,true);//iffileexistsappendtofile.Worksfine.}else{fw=newFileWriter(file);//Iffiledoesnotexist.Crea

java - XSL 导入在 Web 应用程序中导致 FileNotFoundException

我在websphere5下有一个简单的网络应用程序。在appDir\WEB-INF\classes\下我有这些文件:main.xslttemplates.xsltmain.xslt包含指令但是在Java代码中使用main.xslt时应用程序失败。如果导入的XSL文件都在同一文件夹(WEB-INF\classes\),我应该如何指定它们的路径?异常文本:java.io.FileNotFoundException:d:\ProgramFiles\WebSphere\AppServer1\templates.xsl(Thesystemcannotfindthefilespecified.)

java - 使用 File 对象初始化 FileInputStream 时获取 FileNotFoundException

我正在尝试使用File对象初始化FileInputStream对象。我在行中收到FileNotFound错误fis=newFileInputStream(file);这很奇怪,因为我已经多次通过相同的方法打开此文件来执行正则表达式。我的方法如下:privateBufferedInputStreamfileToBIS(Filefile){FileInputStreamfis=null;BufferedInputStreambis=null;try{fis=newFileInputStream(file);bis=newBufferedInputStream(fis);}catch(Fil

java - FileNotFoundException(系统找不到指定的路径)

我得到这个异常:java.io.FileNotFoundException:C:\...\filename.xml(Thesystemcannotfindthepathspecified)使用此代码:FileWriterfileWriter=newFileWriter(newFile(path+date+time"filename.xml"));BufferedWriterwriter=newBufferedWriter(fileWriter);writer.write("data");路径存在,但需要创建“日期”和“时间”的目录。应用程序对该目录具有完全权限。有什么想法吗?

java - 使用 java 属性文件时出现 FileNotFoundException

我在做了很多研究之后问了这个问题,并在研究之后在我的代码中实现了它,但我最终得到了FileNotFoundException。我在这里做的是我想避免在我的java代码中进行硬编码,所以我创建了一个属性名为Constants.properties的文件,并在我的Java代码中调用它。但它说它没有找到该文件。我的属性文件在项目的src文件夹中。下面是代码片段。有什么建议吗?属性文件:executable.run=C:\\server\\lrd.exeincoming.file=C:\\file\\test.icexecutable.params1=-zexecutable.params2=