none
shared project resources.resx file not generating new entries in Resources.Designer

    Question

  • Resources added to a shared project do not result in new items being added to the auto generated file.

    Create a console application (ConsoleApplication1) add a resources file with a string (MyName).

    Compile - to generate the Resources.Designer.cs file

    Add a shared project to the solution, change the default namespace to that of the first project (ConsoleApplication1).

    Reference the shared project in the first (ConsoleApplication1).

    Add a properties folder, move the Resources.resx and corresponding Resources.Designer.cs file from the first project to this folder.

    Add a class to the shared project.

    namespace ConsoleApplication1
    {
        class Class1
        {
            public string Name
            {
                get { return Properties.Resources.MyName; }
            }
        }
    }
    

    The console application:

    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                Class1 c1 = new Class1();
    
                Console.WriteLine(c1.Name);
                Console.ReadKey();
            }
        }
    }
    

    Compile and run - no issues.

    Add a new string to the resources file - it is not added to the Resources.Designer.cs file.

    Oddly enough it seems that the StronglyTypedResourceBuilder is run on the resx file - as changing the value of an existing (in the designer.cs) file causes that resource in the designer.cs to be changed - new values are just not auto generated.

    The solution:

    I am using:

    Microsoft Visual Studio Community 2015
    Version 14.0.25123.00 Update 2
    Microsoft .NET Framework
    Version 4.6.01038
    Installed Version: Community
    Visual Basic 2015   00322-20000-00000-AA089
    Microsoft Visual Basic 2015
    Visual C# 2015   00322-20000-00000-AA089
    Microsoft Visual C# 2015
    Visual C++ 2015   00322-20000-00000-AA089
    Microsoft Visual C++ 2015
    Visual F# 2015   00322-20000-00000-AA089
    Microsoft Visual F# 2015
    Windows Phone SDK 8.0 - ENU   00322-20000-00000-AA089
    Windows Phone SDK 8.0 - ENU
    Application Insights Tools for Visual Studio Package   5.2.60328.3
    Application Insights Tools for Visual Studio
    Arduino for Visual Studio   1.0
    Arduino extension for Visual Studio. For more information please see docs, faq and forum at http://www.visualmicro.com
    ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11106.0
    ASP.NET and Web Tools 2015.1 (Beta8)
    ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
    For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563
    ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
    For additional information, visit http://www.asp.net/
    Common Azure Tools   1.7
    Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
    GhostDoc   5.1.16036.0
    GhostDoc automatically generates XML documentation comments.
    GitHub.VisualStudio   1.0
    A Visual Studio Extension that brings the GitHub Flow into Visual Studio.
    JavaScript Language Service   2.0
    JavaScript Language Service
    JavaScript Project System   2.0
    JavaScript Project System
    JetBrains ReSharper Ultimate 10.0.2   Build 104.0.20151218.120627
    JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.
    Microsoft Azure Mobile Services Tools   1.4
    Microsoft Azure Mobile Services Tools
    NuGet Package Manager   3.4.1
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
    PreEmptive Analytics Visualizer   1.2
    Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
    Python Tools for Visual Studio   2.2.40315.00
    Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.
    Python Tools for Visual Studio - Django Integration   2.2.40315.00
    Provides templates and integration for the Django web framework.
    Python Tools for Visual Studio - Profiling Support   2.2.40315.00
    Profiling support for Python projects.
    SQL Server Data Tools   14.0.60311.1
    Microsoft SQL Server Data Tools
    TypeScript   1.8.29.0
    TypeScript tools for Visual Studio
    Visual Studio Tools for Apache Cordova   Update 8
    Visual Studio Tools for Apache Cordova
    Visual Studio Tools for Universal Windows Apps   14.0.25123.00
    The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.
    Windows Installer XML Toolset   3.10.2.2516
    Windows Installer XML Toolset version 3.10.2.2516
    Copyright (c) Outercurve Foundation. All rights reserved.

    Tuesday, April 12, 2016 8:24 PM

Answers

  • Hi ellipsisware,

    After testing with sample project, we can find that resourse file in common Console application and SharedProject are different. One is .resx and another is .resw. It is the design for Visual Studio for different project type.

    And in my opinion, the SharedProject and .resw file often used in XAML based application. Please refer to : https://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh965323%28v=win.10%29?f=255&MSPPError=-2147217396

    Since this forum is discuss Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.

    Your problem now is about how to use the resource file in your project. I suggest you post your problem to a corresponding forum which is related to your project type. Thanks for your understanding.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.


    Friday, April 22, 2016 1:39 AM
    Moderator

All replies

  • Hi ellipsisware,

    According to your description, I create a sample solution with ConsoleApplication and SharedProject. Then move the Resource file from ConsoleApplication to SharedProject, I get the same problem, the new added string is not generated in the designer.cs file.

    Then I try add a new resource file for SharedProject, I find that the resource file's suffix is .resw and it doesn't have a designer.cs file. But in ConsoleApplication's resource file suffix is .resx.

    The SharedProject is different with a common project. So the resource file are also different. I suggest you add a corresponding resource file for SharedProject.

    Best Regards,
    Weiwei

    Wednesday, April 13, 2016 7:24 AM
    Moderator
  • Thank you for the input!

    I had noticed that if I wanted to add a resource file to the shared project that my only option appeared to be a rsew file as opposed to the rsex extension but it did not seem to do anything (no designer.cs so the resources seem unavailable).

    Using the rsew file did not seem to make a difference.

    If I add a new resource to the resx or rsew file in the shared directory no corresponding entry in the designer.cs file is generated, so the resource is not available unless the designer.cs file is manually edited (same as before).

    This article Creating and retrieving resources states "Despite the difference of file extension, the .resw file format is identical to the .resx file format, except that .resw files may contain only strings and file paths."

    Thursday, April 14, 2016 1:37 AM
  • Hi ellipsisware,

    .resw file and .resx file are both resource file can be used in your project. But there has any difference between .resw file and .resx file. Based on the test by ourself, the structure for these file are dofferent.

    About how to use .resw file, please refer to following link, which provides a sample of application resource. Hope that can help you.

    https://code.msdn.microsoft.com/windowsapps/Application-resources-and-cd0c6eaa

    Best Regards,
    Weiwei

    Friday, April 15, 2016 1:59 AM
    Moderator
  • Thank you WeiWei.

    I was unable to examine the project because when I attempted to load the it I received the following errors:

    Severity Code Description Project File Line Suppression State
    Error CS0246 The type or namespace name 'AppResourceClassLibrary' could not be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario6.xaml.cs 17 Active
    Error CS1061 'App' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'App' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\App.xaml.cs 23 Active
    Error CS1061 'LanguageOverride' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'LanguageOverride' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\LanguageOverride.xaml.cs 30 Active
    Error CS0103 The name 'LanguageOverrideComboBox' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\LanguageOverride.xaml.cs 82 Active
    Error CS0103 The name 'LanguageOverrideComboBox' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\LanguageOverride.xaml.cs 83 Active
    Error CS0103 The name 'LanguageOverrideComboBox' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\LanguageOverride.xaml.cs 84 Active
    Error CS0103 The name 'LanguageOverrideComboBox' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\LanguageOverride.xaml.cs 86 Active
    Error CS1061 'MainPage' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'MainPage' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 26 Active
    Error CS0103 The name 'ContentRoot' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 37 Active
    Error CS0103 The name 'Scenarios' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 41 Active
    Error CS0103 The name 'Scenarios' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 74 Active
    Error CS0103 The name 'Scenarios' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 77 Active
    Error CS0103 The name 'Scenarios' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 78 Active
    Error CS0103 The name 'ContentRoot' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 84 Active
    Error CS0103 The name 'ContentRoot' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 85 Active
    Error CS0103 The name 'InputSection' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 92 Active
    Error CS0103 The name 'InputSection' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 97 Active
    Error CS0103 The name 'DescriptionText' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 108 Active
    Error CS0103 The name 'DescriptionText' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 109 Active
    Error CS0103 The name 'InputSection' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 111 Active
    Error CS0103 The name 'InputSection' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 112 Active
    Error CS0103 The name 'FooterPanel' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 114 Active
    Error CS0103 The name 'FooterPanel' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 115 Active
    Error CS0103 The name 'DescriptionText' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 119 Active
    Error CS0103 The name 'DescriptionText' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 120 Active
    Error CS0103 The name 'InputSection' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 122 Active
    Error CS0103 The name 'InputSection' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 123 Active
    Error CS0103 The name 'FooterPanel' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 125 Active
    Error CS0103 The name 'FooterPanel' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 126 Active
    Error CS0103 The name 'InputSection' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 132 Active
    Error CS0103 The name 'OutputSection' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 133 Active
    Error CS0103 The name 'Scenarios' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 152 Active
    Error CS0103 The name 'Scenarios' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 162 Active
    Error CS0103 The name 'Scenarios' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 163 Active
    Error CS0103 The name 'Scenarios' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 163 Active
    Error CS0103 The name 'InputSection' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 214 Active
    Error CS0103 The name 'OutputSection' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 215 Active
    Error CS0103 The name 'Scenarios' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 228 Active
    Error CS0103 The name 'Scenarios' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 232 Active
    Error CS0103 The name 'Scenarios' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 233 Active
    Error CS0103 The name 'StatusBlock' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 253 Active
    Error CS0103 The name 'StatusBlock' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 257 Active
    Error CS0103 The name 'StatusBlock' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 260 Active
    Error CS0103 The name 'StatusBlock' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 263 Active
    Error CS0103 The name 'StatusBlock' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 265 Active
    Error CS0103 The name 'StatusBlock' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 269 Active
    Error CS0103 The name 'FeatureName' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\MainPage.xaml.cs 280 Active
    Error CS1061 'Scenario1' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario1' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario1.xaml.cs 30 Active
    Error CS1061 'Scenario10' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario10' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario10.xaml.cs 32 Active
    Error CS0103 The name 'Scenario10ComboBox_Language' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario10.xaml.cs 61 Active
    Error CS0103 The name 'Scenario10ComboBox_Scale' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario10.xaml.cs 62 Active
    Error CS0103 The name 'Scenario10ComboBox_Contrast' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario10.xaml.cs 63 Active
    Error CS0103 The name 'Scenario10ComboBox_HomeRegion' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario10.xaml.cs 64 Active
    Error CS1061 'Scenario10' does not contain a definition for 'Scenario10TextBlock' and no extension method 'Scenario10TextBlock' accepting a first argument of type 'Scenario10' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario10.xaml.cs 89 Active
    Error CS1061 'Scenario10' does not contain a definition for 'Scenario10TextBlock' and no extension method 'Scenario10TextBlock' accepting a first argument of type 'Scenario10' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario10.xaml.cs 124 Active
    Error CS1061 'Scenario11' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario11' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario11.xaml.cs 31 Active
    Error CS1061 'Scenario11' does not contain a definition for 'Scenario11TextBlock' and no extension method 'Scenario11TextBlock' accepting a first argument of type 'Scenario11' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario11.xaml.cs 55 Active
    Error CS1061 'Scenario12' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario12' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario12.xaml.cs 32 Active
    Error CS0103 The name 'ViewDependentResourcesList' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario12.xaml.cs 108 Active
    Error CS0103 The name 'ViewIndependentResourcesList' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario12.xaml.cs 109 Active
    Error CS1061 'Scenario13' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario13' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario13.xaml.cs 34 Active
    Error CS0103 The name 'DXFLOptionCombo' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario13.xaml.cs 35 Active
    Error CS0103 The name 'ResultText' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario13.xaml.cs 88 Active
    Error CS1061 'Scenario2' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario2' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario2.xaml.cs 30 Active
    Error CS1061 'Scenario3' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario3' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario3.xaml.cs 31 Active
    Error CS1061 'Scenario3' does not contain a definition for 'Scenario3TextBlock' and no extension method 'Scenario3TextBlock' accepting a first argument of type 'Scenario3' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario3.xaml.cs 41 Active
    Error CS1061 'Scenario3' does not contain a definition for 'Scenario3TextBlock' and no extension method 'Scenario3TextBlock' accepting a first argument of type 'Scenario3' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario3.xaml.cs 56 Active
    Error CS1061 'Scenario4' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario4' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario4.xaml.cs 30 Active
    Error CS1061 'Scenario5' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario5' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario5.xaml.cs 31 Active
    Error CS1061 'Scenario5' does not contain a definition for 'Scenario5TextBlock' and no extension method 'Scenario5TextBlock' accepting a first argument of type 'Scenario5' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario5.xaml.cs 41 Active
    Error CS1061 'Scenario5' does not contain a definition for 'Scenario5TextBlock' and no extension method 'Scenario5TextBlock' accepting a first argument of type 'Scenario5' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario5.xaml.cs 56 Active
    Error CS1061 'Scenario6' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario6' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario6.xaml.cs 32 Active
    Error CS1061 'Scenario6' does not contain a definition for 'Scenario6TextBlock' and no extension method 'Scenario6TextBlock' accepting a first argument of type 'Scenario6' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario6.xaml.cs 56 Active
    Error CS1061 'Scenario6' does not contain a definition for 'Scenario6TextBlock2' and no extension method 'Scenario6TextBlock2' accepting a first argument of type 'Scenario6' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario6.xaml.cs 57 Active
    Error CS0103 The name 'AppResourceClassLibrary' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario6.xaml.cs 57 Active
    Error CS1061 'Scenario7' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario7' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario7.xaml.cs 35 Active
    Error CS1061 'Scenario7' does not contain a definition for 'Scenario7TextBlock' and no extension method 'Scenario7TextBlock' accepting a first argument of type 'Scenario7' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario7.xaml.cs 46 Active
    Error CS1061 'Scenario7' does not contain a definition for 'Scenario7TextBlock' and no extension method 'Scenario7TextBlock' accepting a first argument of type 'Scenario7' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario7.xaml.cs 61 Active
    Error CS1061 'Scenario7' does not contain a definition for 'Scenario7TextBlock' and no extension method 'Scenario7TextBlock' accepting a first argument of type 'Scenario7' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario7.xaml.cs 65 Active
    Error CS1061 'Scenario8' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario8' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario8.xaml.cs 34 Active
    Error CS0103 The name 'LanguageOverrideCombo' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario8.xaml.cs 36 Active
    Error CS0103 The name 'Scenario8MessageTextBlock' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario8.xaml.cs 67 Active
    Error CS1061 'Scenario8' does not contain a definition for 'Scenario8AppLanguagesTextBlock' and no extension method 'Scenario8AppLanguagesTextBlock' accepting a first argument of type 'Scenario8' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario8.xaml.cs 74 Active
    Error CS1061 'Scenario9' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'Scenario9' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario9.xaml.cs 32 Active
    Error CS0103 The name 'Scenario9ComboBox' does not exist in the current context ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario9.xaml.cs 86 Active
    Error CS1061 'Scenario9' does not contain a definition for 'Scenario9TextBlock' and no extension method 'Scenario9TextBlock' accepting a first argument of type 'Scenario9' could be found (are you missing a using directive or an assembly reference?) ApplicationResources C:\Users\Me\Downloads\New folder (2)\Scenario9.xaml.cs 93 Active

    Friday, April 15, 2016 2:52 AM
  • I found the problem with the example, it would not load unless developer mode was enabled, however it does not really fix my problem as the ResourceLoader is obtained from the static function:

    Windows.ApplicationModel.Resources.ResourceLoader.getForCurrentView()

    Which does not appear to be available for desktop applications - I am using the shared project to build a UWP version of a desktop library.

    Friday, April 15, 2016 9:34 PM
  • I was wrong the ResourceLoader is available.

    I will need to see how much work is involved in using the Windows.ApplicationModel.Resources.ResourceLoader instead of the auto generated Designer.cs file.

    Friday, April 15, 2016 9:50 PM
  • Hi ellipsisware,

    Do you have get any new discoveries for the ResourceLoader? Please share anything here after you checking the ResourceLoader. We are waiting for your response.

    Best Regards,
    Weiwei

    Monday, April 18, 2016 2:34 AM
    Moderator
  • I could not get the ResourceLoader to work in a Console application.

    After adding a reference to Windows.Foundation.UniversalApiContract in the project

    and

    using Windows.ApplicationModel.Resources;

    Attempting to obtain a ResourceLoader via:

    var resources = ResourceLoader.GetForCurrentView();

    caused the application to disappear with no message in the Visual Studio output window, encapsulating the call in a try/catch did not help - no exception was caught.

    var resources = new ResourceLoader();
    

    caused an unsupported MRT profile type. (Exception from HRESULT: 0x80073B20)

    I also compared a resx file with one string to a resw file with the same key/string - they are identical.

    As the resx file and corresponding auto generated file work in both the desktop and IoT project I continue to believe that it is an error that newly added resources to not result in new auto generated entris in the designer.cs file.

    Wednesday, April 20, 2016 11:03 PM
  • Hi ellipsisware,

    After testing with sample project, we can find that resourse file in common Console application and SharedProject are different. One is .resx and another is .resw. It is the design for Visual Studio for different project type.

    And in my opinion, the SharedProject and .resw file often used in XAML based application. Please refer to : https://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh965323%28v=win.10%29?f=255&MSPPError=-2147217396

    Since this forum is discuss Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.

    Your problem now is about how to use the resource file in your project. I suggest you post your problem to a corresponding forum which is related to your project type. Thanks for your understanding.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.


    Friday, April 22, 2016 1:39 AM
    Moderator