Should third-party static libraries be included as an item in VC++ 2010 project? - visual-c++

I use third party static library (provided as a .LIB file without source code) in my project. For linking purposes it is enough to add it via "Properties/Linker/Input->Additional Dependencies"
This library is not used in any other project in the solution.
I wonder if I should add it as an item to project file itself. The advantages that I see: it will be immediately obvious that this project uses it and one wouldn't have to add it to version control system manually (anything that is a part of the project/solution is added automatically if you use something like AnkSVN).

The project in VCS must be buildable. It is impossible without the lib. So you should add it.

Related

How do I add non-NuGet packages to ASP.NET MVC application?

This is possibly the dumbest question ever, but I've downloaded the jsPDF library from here: jsPDF. It's not offered through the NuGet packages, so how do I then use it in my .NET MVC project solution? Do I need to move the downloaded folder to the "Packages" folder in my project's directory? Do something else?
Obviously, I'm a total newbie to this, so please keep your answers uncomplicated if possible. Thanks!
A Nuget package is literally just a zip file of a compiled project. If it's C# code, it's a collection of DLLs, but depending on the project, it could have static resources like CSS, JS, etc. It could also have views or other resources. The long and short, is that all of this is just pretty much dumped into your project when you include a Nuget package, much as if you had simply added it yourself.
The slight exception is with DLLs, which are placed in packages simply to keep them organized, and then simply referenced by the project they were added to. Therefore, in order to add something not available as a Nuget, you simply just add all the stuff to your project. If there's JS/CSS and such, then just drop that somewhere in your project. If there's DLLs, create some place to house those on your filesystem, and then add a reference to them in your project. I would not recommend sticking them in the packages directory, because that's managed by Nuget, and it could clobber your DLLs if you put them there.

How to localize a win32 (Non-MFC) DLL

I have few win32 DLL's (Non-MFC) along with individual .rc files for different languages, presently we replace the rc file and build the full DLL again for each locale.
I am trying to find out a better way of doing it and found that MFC DLL's have something called satellite dll's wherein we can have a single DLL for the code and other resource DLL's for individual rc files.
But this resource/satellite DLL's solution doesn't seems to be working for Non-MFC dll's.
Could somebody tell me what would be the best way to localize such non-MFC dll's so that we do not need to regenerate the full Dll for each individual locales.
Thanks in advance
Rahul
There's no reason why you can't do the same with non-MFC dlls - I have done so many times.
You just need to create a set of resource-only DLLs, one for each supported language, and (from your main DLL) either load dynamically at runtime, or give them all the same names and just deploy the correct version during installation.
This MSDN page describes how to create a resource-only DLL. Although it mentions that it's helpful for MFC, there is no necessity to use MFC at all - you can apply the same logic that MFC uses to decide which satellite to load.
Partial screenshot

Auto compiling a dependent project without having a dependency on it

I'm developing ASP.NET MVC with extensive usage of Spring.net.
I have lots of services implemented in different assemblies. The purpose of using Spring and abstract interfaces is to decouple the application from the implementation of services. For example, the Data Access Layer is currently implemented by NHibernate, but the solution is designed to allow this to change.
So I have defined lots of Spring objects from foreign assemblies e.g.
<object id="RepositoryFactory" type="Org.Zighinetto.MyApp.NHibernateBasedRepositoryFactory, Org.Zighinetto.MyApp,NHibernate" />
As we all know, this works as soon as Org.Zighinetto.MyApp.NHibernate.dll example assembly either
Is in GAC
Is in bin directory
As of today, in order to allow quick debugging by hitting F5, I have set a dependency from the main project to all projects it depends on. As we all know, Spring is designed to allow us to cut the dependency between projects, but in this case I use dependencies only to tell Visual Studio to compile and deploy the DLL automatically, otherwise I would have to copy the right DLLs every time I want to debug my project.
The question is straightforward: given that I want to compile, at least in Release mode, my DLLs without unneeded dependencies, how can I make sure that Visual Studio, when I hit F5, automatically compile and deploys all of the Spring-required DLLs (which can be hardcoded by me somewhere, e.g. in a post-compile script) into bin directory?
In the Org.Zighinetto.MyApp example above, I want that once Org.Zighinetto.MyApp.dll gets compiled, VS compiles and deploy also Org.Zighinetto.MyApp.NHibernate.dll without having an explicit reference from .MyApp to .NHibernate
The dependency in you project file does not make the resulting assembly in any way dependent on these referenced files. You can safely have the dependencies there during development and compile your project.
The resulting output will still work when you swap out the assemblies that contain the implementation.

Orchard CMS Custom Module Project File

I have an existing solution (multiple projects, one MVC web project) that I'm trying to wrap into an Orchard module.
All documentation says that the web csproj should be at the root under my module directory (eg Modules/MyModule/MyWeb.csproj).
However, I have an existing solution structure where the sln file sits at the top level and each csproj file (and project content) sits in its own directory (the standard solution structure when you build a multi-project app in Visual Studio).
Is there a way I can tell my Module.txt file that the Orchard Module csproj is under MyModule/MyWeb/MyWeb.csproj? I'd prefer to not restructure the whole solution.
Thank you.
Note: As a point of clarification, it is not ~/Modules/MyModule/MyWeb.csproj but ~/Modules/MyModule/MyModule.csproj. The Folder name of the Module must match the file name of the project (before .csproj). This is enforced by the Dynamic Extension Loader, which requires ~/Module/{ModuleId}/{ModuleId}.csproj. (A similar approach is required for themes.)
The only potential way to do this is to write a custom module that follows the above that contains a custom loader. Within your module, create your own implementation of IExtensionLoader, and register it with Autofac. However, I don't know if it would work; I've never tried.
You will probably have an easier time reorganizing your solution.

monotouch bindings project to framework

What are the correct steps to creating a bindings project for a Framework versus a library? (Yes, they are close to the same thing, but NOT the same, the framework is a directory structure with header files, library and resources). These are what I've come up with, note that none of the Framework specific steps are documented as far as I can tell at the Xamarin web site (please prove me wrong).
Create the bindings project via MonoDevelop wizard.
Generate the ApiDefinition.cs and StructsAndEnums.cs files with btouch or by hand.
Copy the file from the root of the framework directory to lib.a (e.g., ArcGIS to libArcGIS.a) and add it to the project. It is important to note that the file without any file extension in the framework directory is in fact a library file.
?? Include framework resources ??
You'll notice that I get foggy at the third step. How to you add these resources to the bindings project? The large part of the bindings project links and runs fine, but I think it crashes at times because it is missing an expected resource.
You must (a) create a C# contract that describes the Objective-C contracts and how you want your projection into C# to look like, and (b) statically distribute the library with your project.
To kick the automatic population of the linkwith.cs you must rename the framework library (for example MyFramework) to use the library pattern (in this case, "libMyFramework.a")
Resources you have to select and flag as resources, they will be bundled directly into your app, and extracted when the library is consumed.

Resources