0

每次编译项目时,我都会收到此错误。我的 AssemblyInfo.cs 文件没有属性ExcelLocale1033SecurityTransparent. 中没有VisualStudio文件夹C:\Program Files (x86)\MSBuild\Microsoft

The "FindRibbons" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'ProjectName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'ProjectName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

Server stack trace: 
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
4

1 回答 1

0

固定的。这是因为我在 VSTO 解决方案中添加了一个新项目。这个其他项目的输出类型(右键单击项目>属性)曾经是Windows Application. 我将其更改为Class Library并删除Program.cs了包含此代码的内容:

class Program
    {
        static void Main(string[] args)
        {
        }
    }

错误再也没有出现过。

于 2021-07-06T15:13:30.853 回答