我在Windows窗体应用程序中创建了一个Form1.cs,并且已经有一个Form1.resx文件.但每当我尝试运行我的应用程序时,我都会遇到以下错误:
无法为"....\gg\Form1.resx"创建清单资源名称.找不到文件'C:\ Documents and Settings\Administrator\Desktop\gg\Form1.cs'.
有谁能告诉我一个原因,我怎样才能克服我的问题?
Max*_*nce 14
您的.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>
Run Code Online (Sandbox Code Playgroud)
最好远离桌面运行解决方案。(以及“文档和设置”文件夹)。尝试将解决方案文件夹移动到 C:\Projects\ 或 smth,然后重试并查看是否修复它。
或者,如果您没有在表单中使用任何资源,则将其删除(从项目中),下次需要时它将自动添加