简体   繁体   English

使用Visual C#2010 Express编译.sln文件时出现问题

[英]Problem compiling a .sln file with Visual C# 2010 Express

First thing when I try to run the application (I just downloaded it from CodeProject, right here ), I get this error: 当我尝试运行该应用程序时(我刚从CodeProject下载了它,就在这里 ),第一件事,我得到此错误:

The name Resource does not exist in the current context 资源名称在当前上下文中不存在

So when I double click the error it takes me to this code: 因此,当我双击错误时,我将转到以下代码:

private Image mp_CodeImage_Class = Resource._class;

But there is a class called Resource but is in a file called Resource.Designer.cs , and this file is in a resource file called Resource.resx . 但是有一个名为Resource的类,但位于名为Resource.Designer.cs的文件中,而该文件位于名为Resource.resx的资源文件中。 When I check the properties of Resource.resx , Build Action is set to Embedded Resource and Custom Tool is set to PublicResXFileCodeGenerator. 当我检查Resource.resx的属性时,“构建操作”设置为“嵌入式资源”,而“自定义工具”设置为PublicResXFileCodeGenerator。 I'm just saying this details in case they help you find a solution because I know nothing about resources, just almost never use them. 我只是说这些细节,以防它们帮助您找到解决方案,因为我对资源一无所知,几乎永远不会使用它们。 Hope you can help. 希望能对您有所帮助。 Thanks. 谢谢。

For one, you can't open .sln files (which are VS solutions) in the express versions. 首先,您无法在快速版本中打开.sln文件(VS解决方案)。

So what you will need to do is open the project file (.csproj), compile it, close that project and then copy the dll which you've just compiled into your project in which you want to use the control. 因此,您需要做的是打开项目文件(.csproj),对其进行编译,关闭该项目,然后将刚刚编译的dll复制到要在其中使用控件的项目中。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM