C# 无法在VS Web解决方案中添加Resx文件

C# 无法在VS Web解决方案中添加Resx文件,c#,asp.net,.net,resx,C#,Asp.net,.net,Resx,我第一次使用Resx文件。所以我一直到现在都是这样做的 已创建空的Asp.net解决方案。 添加了一个包含基本名称值内容的Resx文件。 添加网页并在代码中隐藏以下代码: 受保护的无效页\u加载对象发送方,事件参数e { ResourceManager rm=new ResourceManagerRusingrex.Resource1, Assembly.GetExecutionGassembly; String strWebsite=rm.GetStringWebsite,CultureInf

我第一次使用Resx文件。所以我一直到现在都是这样做的

已创建空的Asp.net解决方案。 添加了一个包含基本名称值内容的Resx文件。 添加网页并在代码中隐藏以下代码:

受保护的无效页\u加载对象发送方,事件参数e { ResourceManager rm=new ResourceManagerRusingrex.Resource1, Assembly.GetExecutionGassembly; String strWebsite=rm.GetStringWebsite,CultureInfo.CurrentCulture;//这里我得到了一个异常 字符串strName=rm.GetStringName; form1.InnerText=网站:+strWebsite+-Name:+strName; }

但当我运行代码时,我会得到异常:

   Could not find any resources appropriate for the specified
 culture or the neutral culture.  Make sure "UsingRESX.Resource1.resources"
 was correctly embedded or linked into assembly "WebApplication1" at compile 
time, or that all the satellite assemblies required are loadable and fully signed.
本练习我遵循了教程:

所以我尝试的解决方案是:

尝试添加

var assembly = Assembly.GetExecutingAssembly();
assembly.GetManifestResourceNames();

并设置一个断点。这将列出所有嵌入的资源。确保你有正确的名字。有时资源路径并不完全明显。

添加此行会引发错误。无法识别程序集。我将其视为输出WebApplication1.Resource1.resources。这是正确的吗?它只有一个条目。我在原始问题中添加了截图,请看一次。谢谢在原始问题中也添加了我的VS文件夹结构。CultureInfo.CurrentCulture的价值是什么?我是个傻瓜。我需要做的是,我使用了我正在调查的样本中的项目名称。我只是将其更改为正确的项目名称,一切正常。我的项目名称是webapplication1,但我在示例中使用了其他名称。