如何摆脱WPF中的MissingManifestResourceException ?

时间:2022-08-16 23:49:49

I have two assemblies in my application one is where all the code is, the other holds all the images and extra resource files. It was working just fine until I added new images to the resource dll. Now it keeps coming up with MissingManifestResourceException and saying it can't find certain images. All my images are being compiled as Resources.

我的应用程序中有两个程序集,一个是所有代码所在的地方,另一个包含所有映像和额外的资源文件。它工作得很好,直到我向资源dll添加新图像。现在,它不断出现MissingManifestResourceException,并表示它找不到特定的图像。我所有的图像都被编译成资源。

1 个解决方案

#1


0  

Fix this problem as right-click the Resources.resx file in the Solution Explorer and click Run Custom Tool. This re-generates the auto-generated Resources.Designer.cs file.

右键单击参考资料,解决此问题。解决方案资源管理器中的resx文件并单击“运行自定义工具”。这将重新生成自动生成的资源。cs文件。

If the .resx file was added to the project manually, the Custom Tool property of the file must be set to "ResXFileCodeGenerator".

如果将.resx文件手动添加到项目中,则必须将文件的自定义工具属性设置为“ResXFileCodeGenerator”。

Rebuilt that project and then run it

重新构建这个项目,然后运行它

#1


0  

Fix this problem as right-click the Resources.resx file in the Solution Explorer and click Run Custom Tool. This re-generates the auto-generated Resources.Designer.cs file.

右键单击参考资料,解决此问题。解决方案资源管理器中的resx文件并单击“运行自定义工具”。这将重新生成自动生成的资源。cs文件。

If the .resx file was added to the project manually, the Custom Tool property of the file must be set to "ResXFileCodeGenerator".

如果将.resx文件手动添加到项目中,则必须将文件的自定义工具属性设置为“ResXFileCodeGenerator”。

Rebuilt that project and then run it

重新构建这个项目,然后运行它