c# - 无法在 Visual Studio 2008 中创建 list 资源名称错误

标签 c# .net winforms

我在 Windows 窗体应用程序中创建了一个 Form1.cs,并且已经有一个文件 Form1.resx。但是每当我尝试运行我的应用程序时,我都会不断收到以下错误:

Unable to create a manifest resource name for "....\gg\Form1.resx". Could not find file 'C:\Documents and Settings\Administrator\Desktop\gg\Form1.cs'.

谁能告诉我一个原因,我该如何克服我的问题?

最佳答案

您的 .csproj 已损坏。您需要手动编辑它。对于一个表单,必须有 3 个条目:

<Compile Include="MyForm.cs">
  <SubType>Form</SubType>
</Compile>

<Compile Include="MyForm.Designer.cs">
  <DependentUpon>MyForm.cs</DependentUpon>
</Compile>

<EmbeddedResource Include="MyForm.resx">
  <DependentUpon>MyForm.cs</DependentUpon>
  <SubType>Designer</SubType>
</EmbeddedResource>

关于c# - 无法在 Visual Studio 2008 中创建 list 资源名称错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4942332/

相关文章:

C# 将字节数组转换为 int 总是相同的数字

c# - 如何在 Xamarin Forms 中显示嵌套的项目列表?

c# - typescript 中带有 Web Api 和 AngularJS 的 SPA 示例

c# - .net 中的文件传输障碍在 Linux 上使用单声道到 Windows 文件共享

winforms - Winform对话框: detect begin and end of move

c# - 格式化某些绑定(bind)到 Repeater 的项目的输出

c# - HttpClient 异步请求未完成循环发送的大批量

.net - 是否有必要在信号量上调用 Dispose?

c# - 如何在c#中实现一个循序渐进的按钮?

c# - 尝试使用 VB6 Form 调用 OLEDB 提供程序时应用程序消失