Add versioning & company info to Mono DLL using Mono Compiler (mcs) - dll

I'm using MCS to compile some code into a DLL. Plain console compilation, no Visual Studio or similar. That works, the DLL works well.
But I'd also like to add some meta data to the DLL, so that (under Windows -> File properties) the company name and version etc. are visible.
I already tried around with .resx files, created some but that didn't help. Maybe I misunderstood the resx-thing.
The way I did it with the resx file: create a new text file, add the lines
# A list of personal data
company=myCompany
So I guess that was wrong.
How can I add such meta data to my DLL?
Thanks, K1

Related

Minimum of MyProject Files needed

I am writing a very basic library in VB.NET
The library just contains classes and modules.
Now in built output I see this files
Application.Designer.vb
Application.myapp
AssemblyInfo.vb
Resources.Designer.vb
Resources.resx
Settings.Designer.vb
Settings.settings
Since I've seen other libraries with only AssemblyInfo.vb file, I was wondering if I can delete the rest.
What is the minimum of files I need here for the lib to work correctly, since I don't have any ressource or setting?
All the files you listed are necessary for a vb.net library project. And these files are generated (in My Project folder) when the project created not the build output files. So you need to keep all the files you listed in order to develop and build your project locally.
And for the files of build output, you can add these files in .gitignore.
When you create a project in VS, you select a predefined template that dictates what gets created. People often become accustomed to seeing the superfluous objects that a given template creates and assume that those objects are mandatory and must be there, However, much of it is not needed.
There is also the Empty Project template (the exact name of this template varies depending on the VS version used).
In VS2017, selection of the template would look like this:
This is a bare-bones project and the Solution Explorer will look like this:
As you can see, there are no pre-loaded references. You will need to add them yourself. About the only thing defined in this template is that you are using the VB language; This project starts out as a WinForm type, so go to the Project Properties->Application tab and change the "Application type" to "Class Library" since you want to create a library.
You may find it useful to start with an Empty Project and add the stuff you normally use and then export the project as new template (in VS2017: Project Menu->Export Template). For more on creating termplates, see: Creating Project and Item Templates
Edit: I just realized that I did not answer your real question about deleting the unused items. I just did a test case and deleted the items under MyProject. I received an error on deletion, but doing a clean/rebuild allowed me to proceed without issues. I would recommend that you backup the project before attempting this on an existing project, but I saw no long term issues in deleting unneeded objects from MyProject.

Rename class in external dll without losing reference to it in unityEditor

We've got a visualstudio solution with all our code in it and it's completely seperated from our unity project.
When we build our code into a dll from within visualstudio, the dll is copied over to the unity project plugins folder, so we can use the classes from it in our unity project.
This all works fine, but the problem is when we rename a class in our visual studio solution, rebuild the dll and go back to the unity project, the reference to the renamed class is lost in our scene and/or prefabs...
I looked into the scene & prefab files and noticed the references to the classes in the dll are defined as follows:
m_Script: {fileID: 698634159, guid: aa20b9c3579870b40bb96d13672546a3, type: 3}
I read on the forums that the fileID is generated based on the namespace & name of the class file, so logically when the class is renamed, this fileID changes and unity does not know it needs to reference the renamed class.
Is there a way to define a hard references of some kind, so the reference does not get lost when renaming a class? Or any other suggestions to keep references from getting lost.
I've also tried including a meta file with a guid in the dll, but unity does not seem to take this meta file into account, as it always uses the guid of the dll together with the generated fileId.
Unity can't automagickaly find out you have renamed some class inside the DLL. That's true for any form of project : if you depend on some DLL, and classes changes in the DLL, there is no indication of rename.
The best way to link them is adding your Unity project in the solution, and place a dependance between Unity project and the another. Then maybe the refactor tool will suggest you the rename in the Unity project.
Here is a really good tool to find and replace missing scripts, which i assume is the error you are getting.
http://daikonforge.com/forums/resources/fix-missing-scripts.3/
It comes with the source code once you unpack the Unity3d Package, so you can customize it to your needs.

MFC: Steps localizing MFC APP with seperate resource dlls

Before anyone bashes me with, read this first and that second, I have tried following links below to achieve internationalization with MFC.
Creating resourse DLL:
Localization of MFC Components
http://msdn.microsoft.com/en-us/library/x6h91d9w.aspx
Localization for older MFC
htp://support.microsoft.com/kb/198846/en-us
I am new to MFC so please be kind with your answers. So in order to get localization with MFC 7 and above I followed these steps. (Currently using MFC with Visual Studio11)
Created a MFC Project (MyApp) with MFC in a shared DLL
To add a another language (German) to the app, I created a win32 Dll project (MyAppDEU)
Copied the resource file (MyApp.rc) inside same folder and renamed it MyAppDEU.rc
Added the MyAppDEU.rc file to the dll project
In resource view of MyAppDEU.rc, changed the VS_VERSION_INFO -> Block header to "Deutsch (000704b0)"
Changed some strings in the string table to see the difference when the main app loads
Changed the ouput of the MyAppDEU project to build inside the MyApp Output folder
Compiled MyAppDEU to get the Dll
Compiled MyApp with and without following the instructions from point 9
http://support.microsoft.com/kb/198846/en-us
So with all these done, I failed to see any difference in my Application. It loads with the English resouce file which I created the App with. My computer has a German Windows 8 OS. From what I know MFC has inbuilt multilanguage support with Satellite Dlls. I have the correct naming format ApplicationNameXXX.dll. The dlls are in the same directory as the exe.
I hope someone can see what Im doing wrong or missing here. I am fairly new to MFC and appreciate any help regarding this.
[answer adaapted from this SO answer]
I have used a slightly different approach successfully, skipping the MFC inbuilt multilanguage support with Satellite DLLs.
We have multiple DLL projects in our solution, each one containing just one set of resources for a single language (e.g.: AppRes_ENU.DLL). At run-time InitInstance(), we select the appropriate language DLL with code like
CString sResourceDllName;
// format sResourceDllName according to the language ("%s\AppRes_%s.DLL")
hInst_aRes = LoadLibrary(sResourceDllName);
if (hInst_aRes == NULL)
{ // handle <resoure-DLL not available>
return FALSE;
}
AfxSetResourceHandle(hInst_aRes);
and use hInst_aRes to load strings, dialog boxes, ...
Have a look at this software: http://www.apptranslator.com/ . It helps with localisation using satellite dll's; the documentation probably describes how to do it. It's quite simple once you figure our the relationships between ::AfxGetResourceHandle() and hInstanceHandle and all that jazz - the easiest way to learn about that is to read the MFC source. Then you write a few helper classes and off you go :)

How can I distribute a visual studio solution that references a class library

I have a visual studio solution written using VB.net.
The solution contains 4 projects.
A GUI
A Service
A Settings library
A WiX Setup project
Here's how it used to work.
Last week, I had no shared settings library, and all was fine. But, because both the GUI and the Service contained an identical class named ConfigXML.vb (for serializing and deserializing settings), which I was regularly making changes to and copying and pasting between projects, I decided to extract the class into a library project of it's own (3 above).
This week, nothing works!
I added project references to 1. and 2. and things do work the same as they ever did. When I "start debugging" I can see and use the GUI as normal.
However, the problem I have is that when I create and install a new Setup of the solution, both the GUI and the Service fail to start.
I presume that the problem is the settings library is no longer where it was expected to be / hasn't been registered properly, needs to be placed in a directory by the Setup.msi or something similar.
This is my first time doing something like this, so I expect it's an obvious fix that I need.
I gather from the name of that class "...XML.vb" that there is an XML file that lives along side this class on disc. If there is such a file, then you need to add that file to the project and then right click on it go to "Properties" and set the "Copy to Output Directory" to "Copy if Newer"

How to build static library using RAD Studio 2010?

I have been confused by C++ Builder 2010 assuming my library is dynamic. I did not find any options or help in documents regarding what I need to change in the project to build static library.
Now I produce DLL, but I need to produce LIB, so I can just link it to the project and forgot about DLL. BTW it produces LIB, but for dynamic linkage only.
Did you tried Project Props -> Config properties -> Config Type -> Static library (.lib) ?
I know this is old but AFAIK Delphi 2010 doesn't support .bpi (static) files. It was removed at some point. This has been a ballache for us too, as we have a large project that we want to break down into units and for various reasons dynamic libraries won't cut it.
You have to choose "Static Library" when you create the project. You can't convert it once the project already exists. This will create a statically linked library. It should be easy to add your existing source files to the new project and just build.