gpt4 book ai didi

System.IO.FileNotFoundException: Could not load file or assembly SMDiagnostics, The system cannot find the file specified(无法加载文件或程序集SMDiagnostics,系统找不到指定的文件)

转载 作者:bug小助手 更新时间:2023-10-25 13:56:36 25 4
gpt4 key购买 nike



So I am Trying to create a server with a front end in C#. I have a server project (.NETFramework v4.8), a DatabaseLib project(.NETFramework v4.8) and a ClientDesktop project (net7.0-windows)

因此,我正在尝试用C#创建一个具有前端的服务器。我有一个服务器项目(.NETFrameworkv4.8)、一个数据库库项目(.NETFrameworkv4.8)和一个客户端桌面项目(net7.0-windows)


The error message is:

错误消息为:



Unhandled exception. System.Windows.Markup.XamlParseException: 'The invocation of the constructor on type 'ClientDesktop.MainWindow' that matches the specified binding constraints threw an exception.' Line number '6' and line position '9'.
---> System.IO.FileNotFoundException: Could not load file or assembly 'SMDiagnostics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
File name: 'SMDiagnostics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'



I expanded to view the innerException which = null.

我展开以查看innerException,它=NULL。


I have already tried to clean, rebuild, the projects but whenever I run the ClientDesktop that is the error I get. I have looked through a bunch of online questions which are similar and have also made sure they are all set to AnyCPU and are referenced to eachother.
Any help is appreciated and if any further information is needed please let me know.

我已经尝试清理、重建项目,但每当我运行ClientDesktop时,我都会收到错误。我已经看了一大堆类似的在线问题,并确保它们都设置为AnyCPU,并相互引用。感谢任何帮助,如果需要任何进一步的信息,请让我知道。


更多回答

devblogs.microsoft.com/dotnet/…

DevBlos.microsoft.com/dotnet/…

you may need to add the assembly to the ClientDesktop's app manifest

您可能需要将该程序集添加到客户端桌面的应用程序清单中

优秀答案推荐

So turns out the error was because I selected the .NET/.NET core Desktop application instead of .NET Framework Desktop application.

因此,出现错误是因为我选择了.NET/.NET核心桌面应用程序,而不是.NET框架桌面应用程序。


This caused compatibility issues between the 3 projects. Thanks for all the help...

这导致了3个项目之间的兼容性问题。谢谢你所有的帮助。


更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com