标签: filenotfoundexception

"无法加载文件或程序集'XXX.YYY'或其中一个依赖项.系统找不到指定的文件."

我有一个.net visual studio解决方案,包含许多项目(类库和Web应用程序).

我做了一些refractoring,它在项目之间移动文件,创建新项目,删除未使用的项目,并重命名一些现有项目.

解决方案构建没有问题,但是当我运行Web应用程序时,会发生以下异常:

"无法加载文件或程序集'XXX.YYY'或其中一个依赖项.系统找不到指定的文件."

这个名为XXX.YYY的项目在refractoring中被删除了一个名为XXX.YYY的dll.但是这不适用于应用程序中的任何位置.我删除了web应用程序obj目录和bin文件夹并重建但仍然会发生.

任何人都有任何想法,这可能发生,任何提示?

更新:

更新我的问题.我把代码放到另一台计算机上并从那里运行它,它构建并成功运行,没有出现这个问题.所以这让我觉得问题在于我的PC而不是代码库.也许我的电脑上有一些缓存的东西.我确实在"C:\ Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files"中删除了我的临时文件,但没有运气.

所以其他任何可能被缓存或任何其他原因在我的PC上发生.

进一步更新

关于此的另一个更新.我在其他开发者机器上运行了相同的代码,并没有运行它的问题.所以一定要在我的机器上做点什么!我们机器上唯一不同的是我在经典模式下使用应用程序的应用程序池运行IIS7.另一个开发人员正在运行IIS6.

2件新信息.首先在我的web.config中的httpmodules中,我必须在添加之前删除自定义http模块.其他开发人员不必这样做.其次,我已经能够修复"无法加载文件或程序集'XXX.YYY'或其中一个依赖项"的问题,通过"hack",这只是一个短期修复,通过在我的项目中创建一个名为XXX的类库.YYY并包括要查找的类,这些都是自定义控件,即.继承自System.Web.UI.WebControls.WebControl.

还有什么想法......

c# dll exception filenotfoundexception visual-studio

9
推荐指数
2
解决办法
3万
查看次数

ASP.NET中的C++/CLI组件出现"无法找到模块"错误

我必须在我的一个ASP.NET项目中包含一个(托管的)C++/CLI组件,它自己引用一些其他(非托管)C++ DLL.应该没问题 - .NET 3.5很高兴在编译项目时,一切看起来都很好.C++/CLI组件和其他C++ DLL由另一个部门编译为Visual Studio 2005中带有"Any CPU"的Release版本.安装了VC++ 2005 Redistributable软件包.当我在普通的.NET控制台应用程序中运行它时,相同的代码可以正常工作.

现在,虽然此代码在控制台应用程序中工作,但它没有被ASP.NET正确托管 - 它导致初始页面加载时出错(甚至在进入Global.asax之前).为了测试和调试,我使用了两种机器配置:

  1. 本地开发PC:Windows XP,32位,VC++ 2005 Redist包,Visual Studio 2010,ASP.NET 3.5,编译"任何CPU",在Web开发服务器(Cassini)中托管
  2. 测试服务器(目标机器):Windows 7,64位,VC++ 2005 Redist包,在IIS 7中托管,AppPool具有"启用32位应用程序"集

在两台计算机上,当我启动ASP.NET应用程序时出现相同的跟随错误:

Exception Details: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

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.

Stack Trace:
[FileNotFoundException: The …
Run Code Online (Sandbox Code Playgroud)

c++ asp.net dll c++-cli filenotfoundexception

9
推荐指数
2
解决办法
2890
查看次数

Android - 如何从原始文件获取Uri?

我试图Uri从文件raw夹中的项目中包含的原始文件中获取.但FileNotFoundException无论怎样,我都会得到一个.

该文件是一个.wav文件,也尝试过它.mp4,也不起作用.使用MediaPlayerDOES 播放这两个文件.

Uri回报:mark.dijkema.android.eindopdracht/2130968576

我的代码:

package mark.dijkema.android.eindopdracht;

import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import android.app.Activity;
import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioTrack;
import android.net.Uri;
import android.os.Bundle;

public class MainActivity extends Activity
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        PlayWaveFile();
    }

    private void PlayWaveFile()
    {
        // define the buffer size for audio track
        int minBufferSize = AudioTrack.getMinBufferSize(8000, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT);
        int bufferSize …
Run Code Online (Sandbox Code Playgroud)

java android uri filenotfoundexception

9
推荐指数
3
解决办法
2万
查看次数

<init>和(Native Method)是什么意思?

这些符号表示什么以及(Native方法)对该java.io.FileStream.open方法的说法是什么?

Exception in thread "main" java.io.FileNotFoundException: line23 (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:135)
at java.io.FileInputStream.<init>(FileInputStream.java:95)
at java.io.FileReader.<init>(FileReader.java:64) at Helper.readFile(Foo5.java:74)
at Bar2.main(Bar2.java:32)
Run Code Online (Sandbox Code Playgroud)

java methods native init filenotfoundexception

9
推荐指数
1
解决办法
915
查看次数

如何处理try catch异常android

我正在使用方法getBitmap来显示图像.当我使用它作为方法时,如果它返回位图显示图像但是如果它返回null,则捕获异常.但是如果输入的url也是错误的,它应该处理FileNotFoundException.如何处理两个异常并在UI中显示?

public Bitmap getBitmap(final String src) {

        try {
              InputStream stream = null;
              URL url = new URL(src);
         java.net.URL url = new java.net.URL(src);
              URLConnection connection = url.openConnection();

            InputStream input = connection.getInputStream();
            myBitmaps = BitmapFactory.decodeStream(input);    
           return myBitmaps;        
         } catch (IOException e) {
            e.printStackTrace(); 
            Log.e("IO","IO"+e);
            return null;
        } 
        catch(OutOfMemoryError e1) {
             e1.printStackTrace();  
             Log.e("Memory exceptions","exceptions"+e1);
             return null;
        }
        }
Run Code Online (Sandbox Code Playgroud)

在活动中,我已经这样给了

    Bitmap filename=service.getBitmap(url_box.getText().toString());
    if(file_name!=null)
        {
          displaybitmap(file_name);
        } 
    else
       {  //Toast.makeText("Memory Error");
       //my question is how to handle two exception in UI where memory error …
Run Code Online (Sandbox Code Playgroud)

android exception-handling bitmap filenotfoundexception out-of-memory

9
推荐指数
2
解决办法
5万
查看次数

eclipse中的java.io.FileNotFoundException

码:

import java.io.*;
import java.util.Scanner;

public class Driver {

    private int colorStrength;
    private String color;

    public static void main(String[] args) throws IOException {

        String line, file = "strength.txt";

        File openFile = new File(file);
        Scanner inFile = new Scanner(openFile);

        while (inFile.hasNext()) {
            line = inFile.nextLine();
            System.out.println(line);
        }

        inFile.close();
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我为一个类编写的程序的一小部分(我知道这两个私有属性尚未使用)但是当我尝试使用strength.txt文件运行它时,我收到以下错误:

例外:

Exception in thread "main" java.io.FileNotFoundException: strength.txt (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.util.Scanner.<init>(Unknown Source)
at Driver.main(Driver.java:14)
Run Code Online (Sandbox Code Playgroud)

如果有人用Eclipse可以帮我解决这个问题,我将不胜感激!

java eclipse filenotfoundexception

9
推荐指数
1
解决办法
4万
查看次数

尝试写入文件时出现FileNotFound异常

好吧,我觉得这应该很容易,但显然缺少用Java编写文件的基本内容.我有这个:

File someFile = new File("someDirA/someDirB/someDirC/filename.txt");
Run Code Online (Sandbox Code Playgroud)

我只是想写信给文件.但是,虽然someDirA存在,但someDirB(因此someDirC和filename.txt)不存在.这样做:

BufferedWriter writer = new BufferedWriter(new FileWriter(someFile));
Run Code Online (Sandbox Code Playgroud)

抛出一个FileNotFoundException.好吧,呃,不开玩笑.毕竟我正在努力创造它.我是否需要将文件路径分解为组件,创建目录,然后在实例化FileWriter对象之前创建文件?

java exception file filenotfoundexception

8
推荐指数
1
解决办法
1万
查看次数

部署NetFwTypeLib以管理Windows防火墙

我的Windows服务需要从Windows防火墙创建/删除某些规则.对于这一点,我界面NetFwTypeLib<windows>\system32\hnetcfg.dll通过COM.它在我的64位Windows 7计算机上运行良好,但在另一台64位Windows 7计算机上进行测试会引发以下错误:

Service cannot be started. System.IO.FileNotFoundException:
Could not load file or assembly 'Interop.NetFwTypeLib, 
   Version=1.0.0.0, Culture=neutral,
   PublicKeyToken=null' or one of its dependencies.
   The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)

我有一种感觉,如果我使用我的应用程序嵌入并安装程序集,我会遇到不同版本的Windows以及32位和64位之间的问题.

如何解决这个缺少的装配部署问题?


编辑:这似乎是除了4.0之外的任何目标框架的VS2010问题.有人有解决方法吗?

c# deployment assemblies windows-firewall filenotfoundexception

8
推荐指数
2
解决办法
1万
查看次数

Xamarin构建错误加载程序集时出现异常:System.IO.FileNotFoundException

总是我尝试构建我的Xamarin应用程序我得到此错误.我不知道为什么.我使用.Net Framework 4的System.Security.dll,虽然这应该工作.谢谢.

C:\ Program Files(x86)\ MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2):错误:加载程序集时出现异常:System.IO.FileNotFoundException:无法加载程序集'System.Security, Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'.也许它在Mono for Android配置文件中不存在?

Dateiname:'System.Security.dll'

bei Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference,ReaderParameters parameters)

bei Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1程序集,AssemblyDefinition程序集)

bei Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1程序集,AssemblyDefinition程序集)

bei Xamarin.Android.Tasks.ResolveAssemblies.Execute()(TaskManager2)

exception build filenotfoundexception xamarin

8
推荐指数
2
解决办法
1万
查看次数

Java使用文件夹FileNotFound异常解压缩压缩存档

我试图在java中解压缩包含文件夹以及存档内的文件的存档.问题是,只要它到达文件夹并尝试解压缩它们就会抛出FNF异常.我的解压缩代码如下:

 private void unZipUpdate(String pathToUpdateZip, String destinationPath){
       byte[] byteBuffer = new byte[1024];

       try{
           ZipInputStream inZip = new ZipInputStream(new FileInputStream(pathToUpdateZip));
           ZipEntry inZipEntry = inZip.getNextEntry();
           while(inZipEntry != null){
               String fileName = inZipEntry.getName();
               File unZippedFile = new File(destinationPath + File.separator + fileName);


               System.out.println("Unzipping: " + unZippedFile.getAbsoluteFile());
               new File(unZippedFile.getParent()).mkdirs();


               FileOutputStream unZippedFileOutputStream = new FileOutputStream(unZippedFile);
               int length;
               while((length = inZip.read(byteBuffer)) > 0){
                   unZippedFileOutputStream.write(byteBuffer,0,length);
               }
               unZippedFileOutputStream.close();
               inZipEntry = inZip.getNextEntry();
           }
           inZipEntry.clone();
           inZip.close();
           System.out.println("Finished Unzipping");
       }catch(IOException e){
           e.printStackTrace();
       }
    }
Run Code Online (Sandbox Code Playgroud)

我以为我有处理过的压缩文件夹

new File(unZippedFile.getParent()).mkdirs();
Run Code Online (Sandbox Code Playgroud)

但这似乎并未解决问题.我在这里错过了什么?

堆栈跟踪:

Unzipping: D:\UnzipTest\aspell …
Run Code Online (Sandbox Code Playgroud)

java io filenotfoundexception

8
推荐指数
1
解决办法
1663
查看次数