0
我正面臨一個奇怪的問題。我有一個在VS2010中運行的應用程序,其中與VS2010中的幾個項目有關,編排中的資源文件位於單獨的項目中。我添加了一個winform項目,並試圖從resourcefile(.Resx)文件項目中獲取新增值。但是我不是獲得這個價值。我再次添加了一個虛擬winform項目,並嘗試獲得相同的新增資源值,並且令人驚訝的是我正在獲取值。所以我想知道新增項目會發生什麼。任何機構都可以告訴我我需要做什麼?如何獲取存儲在資源文件中的字符串值(.resx)
我像顯示below.Here「樣本」新增加的winform項目訪問資源值是資源的一類相關sperate項目稱爲Test.Resources
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Test.Resources;
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MessageBox.Show(Sample.leaves.GetString("Admin.MinInvalid.Error"));
Application.Run(new Form1());
}
UPDATE
這個問題與簽署問題有關。因爲新添加的winfrom項目是用關鍵字簽名的,因爲這個虛擬項目不是
簽署項目時出現問題 – vettori