I need to rebrand my application, that means create another application resource file with different strings, slash screen and icons.
My application is also localized for a second language, i have another resource file with all application string which is translated, that creates me additional, satellite dll.
I need to build 4 setup project 2 for each language and 2 for each brand name.
What will the elegant solution for this? Is there any way to create additional application resource file same way I did with language translation and how I include a satellite (resource in a second language dll) in my setup project and not including resources in the original, neutral language.
Thank you.
I assume that those branding resources are not in setup project, but in main project, and that main project is C++.
In C++ you can have several .rc files in a project. This is most likely true for C# resources too. Move all branding material to second resource file. Create another project, shallow in nature, that references all files (including .rc) from original, but uses its own versions of branding files. Apart from strings, icons, and images maybe you will have some dialogs copied and branded as well. Make sure they all have resource identifiers in sync.
Creating another project can be done by just copying original project and fiddling with paths in text editor. Just make sure you change the project GUID, so that two project can coexist in the same solution.
Related
My ASP.Net Core MVC project consists of 3 website projects, plus associated unit test projects, all collected in a single solution. Each of the website projects relies on common stuff, such as JavaScript libraries (under wwwroot/js/...) and views (under views/...). Is there some feature that lets me package up these files (none of which, as far as I know, can live in a NetStandard library project) and "install" them in all of my website projects so I only need to maintain them in a single place?
A razor class library (RCL) almost does what I want to do, but I want to be able to reference my JavaScript library from views in all three website projects. I also want the bundler/minimizer to be able to find my common JavaScript and CSS files. As far as I can tell, RCL only allows the Razor Pages in the RCL to access the static content (things like my JavaScript and CSS files) in the RCL.
EDIT:
After more thought, I've come to the conclusion that what I'm asking for simply can't be done "out of the box". In order to work correctly, the debugger and the bundler/minimizer need to find js and css files in the project's directory tree. What I'm asking for is a way to have something like a "reference project" that contains these "shared" files. I'm thinking that it's time for the "science project" approach: I'll create a reference project that contains the shared files, and run some code (at build time? via MSBuild? via unit test code?) that updates the files in the project from the reference project if they don't match.
FWIW, here's what I wound up doing:
In my 3 website projects, I have common files in several places:
Views/Shared
wwwroot/js/MyJsLibrary
wwwroot/css/MyCssLibrary
I created a "reference" project that contains copies of the common files in these folders. Then I created a unit test that simply verifies that the files in the "reference" project exist and are identical to files in each of the 3 websites.
No automated magic to keep the folders in sync. If someone changes one of the common files then the unit tests will fail until someone copies the updated file to the website projects and to the "reference" project.
I'm creating a RN app that is meant to be some kind of wrapper. It should have multiple targets (like in Xcode) and all its content (images, text, etc.) should be target dependent. Unfortunately, I cannot find any useful informations about how to achieve this without opening Xcode or Android Studio project and create those targets manually (like here). Is there any other solutions for this?
I was still struggling with described problem but I finally found a solution. It's not easy, needs writing a bit of boilerplate code and looks more like a workaround but I hope it will help someone in the future. What I did is I have completed my wrapper app with the resources for one of my targets so I can have visual effect. In the project's root directory I've created a folder with subfolders for each target. Inside each I have put files (images, source code files, other assets) that are target-dependent. Then I've created bash script that takes one argument - target's name. Based on it, it replaces all the target-dependent files from target's subfolder to the original file's destination in the project structure. In this proces all meta-data informations are also replaced so after firing .sh file I can build the app and upload it to both stores. It's really time consuming to create all these apps separately and publish them and it's maybe not the best solution, but at least it works!
On android, you can edit build.gradle files, java or properties, without having to launch Android Studio (which simply uses Gradle)
You can build different type flavours by only changing app/build.gradle
On iOS, that's another story. Project file (.pbxproj) is a mess,and other Workspace/Scheme files are not easy to read or script. So XCode is the way to Go.
I tried to have dynamic target & Info.plist, there are tools to script that like PlistBuddy
in the end, I saw there are many ways to launch a React Native app for developpers. Some prefer the command line, and only VSCode.
Others want to play with native IDE.
By the way, native IDEs are VERY useful.
e.g. : you want to fine-tune your application performance, using XCode view hierarchy debugger or android Studio Layout Inspector (and be sure you don't use to many views), or use any other performance tools these IDEs offer...
In the end, I used react-native-config along with multiple almost similar configs (Info.plist < target < Scheme for each), here's a post giving an overview of the setup.
I have a question about organizing .resx files in mvc3 application. So far I have managed to do the following:
Creating new class library in a solution for resources and adding resources for two languages. Everything works fine when I have for example:
Resources.resx //default language
Resources.en.resx //english language
But I want to have such organization in my class library:
DefaultLanguage foder
- Resources.resx
en folder
- Resources.en.resx
I want to organize resources by folders. I think it is more appropriate for people who will translate the site and it is also more maintainable. When I organize resources in such a way the web page returns an error...cannot find error. Am I missing something? I know that you should not have folder name in namespace because that would mean that referencing resource in View is dependent on folder name and this is not correct.
The point is I would like to have the same behaviour of resources wheter they are organized in folders or not...
By the way: I check on the web and could not find any appropriate solution.
Thank you for your answers!
MVC3 uses ASP.NET resource management. See ASP.NET documentation for details. If you want to rely on ASP.NET behaviour and generated strongly typed classes, then you must keep resource file from default language and other language specific resource files together.
To have the same tree structure that you suggested, then you have to implement your own resource management. You probably don't want to do that, because (at least some) resource editing tools rely on that behaviour.
On our projects we have one resource (and his translations) for each view. They are in folder Localization within MVC3 project. Inside we keep the same tree structure as is within Views folder. This is more or less the same as ASP.NET local resources are organized. Common strings are kept in one .resx file on root of Localization folder. This ensures maintainability.
To keep your people that will do translation happy you have to pick good .resx editing tool.
Being new to VS, how may I think of these two concepts, what is the difference?
I find some missing information in the other answers (at least for people who come from other IDEs like, say, Eclipse) . To say that a solution is a container for projects is only part of the thing. The conceptual feature of a VS project (what determines its 'granularity') is that one project produces one output: typically an executable or a library (dll). So, if you are going to code three executables that uses related code, you'll create one solution and at least three projects - probably more.
A solution is a container for projects, and tracks dependencies between projects.
Just to come up with a metaphor..
A solution is like a house, a project like a room. Each room provides a piece of functionality whereas the house, a container of rooms, provides the means to link the rooms together and organize them appropriately.
Kind of corny but I made it up on the fly, so bear with me :)
It doesn't help that Visual Studio seems to make things more confusing. "New Project" actually creates a new SOLUTION containing a project. "Open Project" actually opens a solution containing one (or many) project. (The file menu says "Open Project/Solution" but it really is opening solutions. There is no "Close Project" only "Close Solution" which is accurate.
So, in VS you are always working within a solution. Many solutions contain only one project and newer developers are likely to think of them as the same thing. However you can add other projects into a solution.
In case anyone decides to scroll down this far... I thought the MS docs did a pretty good job at describing the differences. I've copy pasted (and rephrased) the relevant bits here:
When you create an app, application, website, Web App, script, plug-in, etc in Visual Studio, you start with a project. In a logical sense, a project contains of all the source code files, icons, images, data files and anything else that will be compiled into an executable program or web site, or else is needed in order to perform the compilation. A project also contains all the compiler settings and other configuration files that might be needed by various services or components that your program will communicate with.
You don't have to use solutions or projects if you don't want to. You can simply open the files in Visual Studio and start editing your code.
In a literal sense, a project is an XML file (.vbproj, .csproj, .vcxproj) that defines a virtual folder hierarchy along with paths to all the items it "contains" and all the build settings.
In Visual Studio, the project file is used by Solution Explorer to display the project contents and settings. When you compile your project, the MSBuild engine consumes the project file to create the executable. You can also customize projects to product other kinds of output.
A project is contained, in a logical sense and in the file system, within a solution, which may contain one or more projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with any project. In a literal sense, the solution is a text file with its own unique format; it is generally not intended to be edited by hand.
A solution has an associated .suo file that stores settings, preferences and configuration information for each user that has worked on the project.
A Solution can have many Projects.
The Solution can also handle managing the dependencies between its different Projects...making sure that each Project gets Built in the appropriate order for the final Solution to work.
A project contains executable and library files that make up an application or component of an application.
A solution is a placeholder for logically related projects that make up an application. For example, you could have separate projects for your application's GUI, database access layer, and so on. The projects would be specific divisions for your program's functionality, and the solution would be the umbrella unifying all of them under one application.
A solution is a readable text file whose extension is .sln and having a structured content that describes the projects that it contains. A project is a readable XML formatted text file whose extension is .vcxproj and having a structured content according to its XML schema, and whose primary purpose is to contain the listing of source codes filenames and their dependencies or references to other project's source codes as well.
Solutions are containers for projects - you can also use them to organize items that are used across different related project (shared dll's and such).
Solutions are containers used by Visual Studio to organize one or more related projects. When you open a solution in Visual Studio, it will automatically load all the projects it contains.
When you create a new project in Visual Studio, it automatically creates a solution to house the project if there's not a solution already open.
You can set dependencies of projects on other projects in the solution. The dependent project is build after the project it is depending on is built.
For more details refer - https://learn.microsoft.com/en-us/visualstudio/ide/quickstart-projects-solutions
If you are from an Eclipse background you would probably go to build path of a project and add a dependency on other project or add an external jar. In VS you can do that in a single container called solution where all related projects are grouped together.
Eg. Let's say you are build and android and iOS app in xamrin, there would be some common code and resources that could go in a separate project and then your android and iOS projects can depend on this common code project. Also you could have projects to test these projects etc.
I have all the forms in one folder and all the code modules in an other folder in VB6. How do I create a better folder structure for the source files?
For example if I have twenty forms and twenty code modules, how can I create subfolders Main, Sales, and Employees and put the source files under those subfolders?
You should investigate whether some of your files could reside in a ActiveX DLL instead of the main EXE project. As Konrad pointed out the VB6 IDE project explorer doesn't support folders. Large VB6 projects, like my own, organize the classes into a hierarchy of ActiveX DLLs. For example Utility DLL which has commonly used routines used across the company's applications (file handling, etc). Business Object DLL which has the specific classes used by your applications. Report DLL has the classes that handles reports for that applications. And so on.
The gotcha is that you have to worry about compatibility issues between versions.
You can (and should) create subfolders in the file system to organize your files. However, this hierarchy will not be mirrored by the VB6 project explorer, which basically provides a flat hierarchy.
well if you're talking about adding a new folder from vb6 project explorer view,
i'm not sure that you can do so.
but if you want to sort it you can apply some naming convention, i.e. module1_xxx, module1_yyy.