We have a solution with a joint project referenced by two other projects.
In the general project, we have resx files, but we noticed that the code-behind Designer.cs file does not update when conditions are added or changed in resx. Apparently, creating custom tools (ResXFileCodeGenerator) for embedded resources is not supported in shared projects.
I have been looking for quite some time to overcome this limitation. I tried to create a class library with all resource files, but then I came across a problem that I can not add a link to this class library in the general project.
Does anyone know how I can fix this? The presence of resource files in the class library and the possibility of their use in our common design concepts?
-
Besides the problem described above, we can get resx files working on projects when we just add the code to the Designer.cs file, but still it looks like there are still some problems.
For example, in a view, we can get translations through our namespace and name, but in the IDE they appear as red (not resolvable). However, if we run the application, it works as it should.
UPDATE: I was able to get translations from the resx file into a separate project, which is shown in my views when the application starts. However, in the general project where the views are located, my links to the resx file resx still displayed in red. This is probably due to the fact that common projects do not have references to the translation project. After creating "real" projects that have a link, they can find resx translations, so no problem starting the application.
Is there a way to tell visual studio that my shared project uses resx files from a separate class library so that it finds terms and does not underline my links? It would be nice to work with intellisense.
As pointed out in the comments, see snippet of my View / Html code:
@using System.Configuration @{ ViewBag.Title = "ManageCategories"; } <div class="main container-fluid"> <div id="spis-categories" ng-controller="categoriesController as categoriesVm" ng-cloak ng-init="categoriesVm.siteName='@ConfigurationManager.AppSettings["siteName"]';categoriesVm.pageSize = @inConnexion.Common.Constants.Constants.PageSize"> <div class="modal cust-modal-ontop" tabindex="-1" role="dialog" id="confirmDeleteDialog" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog cust-modal-dialog"> <div class="modal-content cust-modal-content"> <div class="modal-header"> <h4 class="modal-title">@CategoryResources.SPIS_Categories_Maintenance.Button_Delete</h4> </div> <div class="modal-body"> <p>@CategoryResources.SPIS_Categories_Maintenance.Confirm_Delete</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" ng-click="categoriesVm.doDeleteSelected();"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span> @CategoryResources.SPIS_Categories_Maintenance.Label_Yes</button> <button type="button" class="btn btn-default" ng-click="categoriesVm.cancelDeleteSelected();"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> @CategoryResources.SPIS_Categories_Maintenance.Label_No</button> </div> </div> </div> </div>
And then look at this screenshot where the links are not recognized:

Please also note that the ViewBag is also not recognized. But at startup, everything works as expected ...