If you’re using an app.manifest, and defining assembly dependencies (i.e. for SxS / Side by side / Reg-free COM etc), you may encounter this error when you build the project:
Could not find file ‘AssemblyName, Version=x.x.x.x, PublicKeyToken=xxxxxxxxxxx, ProcessorArchitecture=x86, Type=win32′.
This is even when the native assembly is in place where the project can find it.
For example, your app.manifest may contain this fragment:
<assemblyIdentity name=“Native.Custom“ version=“22.214.171.124“ processorArchitecture=“x86“ type=“win32“ publicKeyToken=“12345678“/>
This manifest is available to the project, with the manifest file in the project directory or in a subdirectory called “Native.Custom”.
In this case, I have a sub directory called Native.Custom, which contains my Native.Custom.manifest file.
The problem may be because the ClickOnce manifests are being generated.
- Open your project file in a text editor (or right click it in Visual Studio and choose Edit Project)
- Find the GenerateManifests element and set it to false:
- Save the project and reload it.
Now you should hopefully be able to build.