What is ResolveAssemblyReference.cache?

2019-03-09 07:02发布

问题:

I'm trying to figure out what this file is (or rather, these files are) for.

I've found a number of webpages that mention it, but the answer to the question is always something like "this file is not your problem" -- without describing what the file is. I don't seen an obvious page on MSDN, either.

The files themselves are pretty big, and not text-only (though they have a lot of text). I'm guessing it's something used during compilation only, though the modification date is older than any of my object files. Is this related to *.pdb files or debugging at all?

回答1:

It is a file produced by the ResolveAssemblyReference build target. MSDN has this to say about it:

Visual Studio attempts to execute targets with certain names when it loads a project. These targets include Compile, ResolveAssemblyReferences, ResolveCOMReferences, GetFrameworkPaths, and CopyRunEnvironmentFiles. Visual Studio runs these targets so that the compiler can be initialized to provide IntelliSense, the debugger can be initialized, and references displayed in Solution Explorer can be resolved. If these targets are not present, the project will load and build correctly but the design-time experience in Visual Studio will not be fully functional.

If I interpret this correctly, I'd say that the file is used to help the IDE provide proper IntelliSense and assembly reference status in the References node. It is a fairly expensive operation since there are potentially a lot of assemblies that can be referenced. So instead of doing this repeatedly, the .cache file can help make this quick. Deleting it isn't an issue, it will be recreated when the project is reloaded.



回答2:

exclude "obj\debug" folder from your project. Rebuild it and host...