I have several class libraries within my MVC application which each have a Settings file with its own configuration file. With each configuration file being App.config, how are these aggregated into one configuration file? Should the settings be placed in web.config? Suggested best practice?
When you build each class library you'll notice that the app.config file is copied to the bin\output folder with a name like "myclasslibrary.dll.config". This means that each DLL will have it's own config file each with a unique name. You can just include the *.dll.config files in your website's bin folder along with the DLLs and your settings will be picked up.
You can also combine settings from a library's app.config into the web.config file by adding new <section> declarations inside <configSections>.
This MSDN walkthrough has an example: http://msdn.microsoft.com/en-us/library/ms246220%28VS.80%29.aspx
Then you wont need separate config files.
Related
VisualStudio 2019, I have two projects in a solution which essentially need to share a single CSS. I have the physical file added to project A, and then I added the same file as a "link" file in Project B. This way only 1 file needed to be updated.
I have my bundleConfig set up properly, but the linked file is never included in the bundle in Project B.
I didn't see any options for doing so in the bundle config. Any other option besides duplicating a physical file?
I have a folder with a lot of .so files which I'm trying to use while my code is running.
I place them in a folder called "External" and then I try to access them like this:
[DllImport("External\\libvocon_ext_heap.so", EntryPoint = "ph_CreateWin32PrivateHeap", CallingConvention = CallingConvention.Cdecl)]
public static extern PH_ERROR ph_CreateWin32PrivateHeap(ref LH_HEAP_INTERFACE pHeapInterface, out IntPtr ppHeapInst);
I've also tried to place the files in the Assets folder, but i still get the same System.DllNotFoundException
This is a late answer but I did find the solution to my problem. The main issue was how I stored the library files in the project. In order to locate the library files they have to be stored under specific directories. Instead of storing them in the "External" directory as I did, they must be stored in a directory with the name "libs" and a specific subdirectory like the following:
libs>armeabi>libfoo.so
libs>armeabi-v7a>libfoo.so
libs>x86>libfoo.so
Because Android CPUs can be based on 3 different ARM architecture, there has to be a directory for each of those architectures (armeabi, armeabi-v7a, x86). I imported the library files like this:
[DllImport("libvocon_ext_heap.so", EntryPoint = "ph_CreateWin32PrivateHeap", CallingConvention = CallingConvention.Cdecl)]
You only need to write the name of the library file since it will locate the right directory path by itself. You can also write the name like "vocon_ext_heap" since it can automatically add the "lib" and ".so" to the file name if it is missing.
I also re-installed the Xamarin SDK manager because I found a possible solution asking to re-install it, but I don't know if it fixed anything related to this problem. Also, the libraries of course has to be build as AndroidNativeLibrary as Softlion mentioned.
Have you set the build action of your so file to AndroidNativeLibrary ?
See https://developer.xamarin.com/guides/android/advanced_topics/using_native_libraries/
I saw on a Microsoft forum that I can create a .tfignore file and place it in the root folder.
I have a folder named Libs and it contains DLL files that I want to keep under source control. How can I use the .tfignore file to include my Libs folder in source coutrol?
You can negate inherited rules in a .tfignore file. In your case, try adding a .tfignore file to your Libs subdirectory with the following content:
\# Do not ignore .dll files in this folder nor in any of its sub-folders
!*.dll
The not (!) operator essentially reverses the rule and says "do indeed include these files types."
For more details see http://msdn.microsoft.com/en-us/library/vstudio/ms245454.aspx. Look at the sections titled ".tfignore file rules" and ".tfignore file example"
i a developing blackberry aplication using eclipse can any one tell where to find the following library
package com.rim.samples.docs.notifications;
i have downloaded it from blackberry site but i dont know how to use it
com.rim.samples.docs namespace is common for samples BlackBerry Application Developer Guide.
On the other hand, "package" token defines the packege namespace, not the import.
If you have downloaded code and post it to namespace with other name, you may have trouble to compile it. Resolve it in two ways:
1. if your code file is placed directly in project src folder, simply remove
package com.rim.samples.docs.notifications;
from code, this will set namespace to default.
2. in project src folder create folder "com\rim\samples\docs\notifications" and move file to folder "notifications".
I create my solution by using Asp.net MVC pattern which has at least 4 projects.
App.Models
App.Globalization
App.Controllers
References : App.Model and App.Globalization
App.Views
References : App.Model, App.Globalization and App.Controller
I need to create .net resources file for using by both App.Controller project and App.Views project. First, I try to create App.Globalization project for sharing resources. But I need to save resx file in App_Globalization folder in App.Views project and save designer.cs file(generated code of resx file) in App.Globalization project because it's easy to modify & save data in resources file.
Is it possible for creating separated resouce files for Asp.net MVC without using custom tool(s) or post-build command?
It's very easy by using the following step.
Add resource file to App_GlobalResources folder in App.Views project.
Set Build Action property of designer.cs file to None.
Unload App.Globalization project.
Edit App.Globalization project by adding the following code.
<Project>
<ItemGroup>
<Compile Include="..\App.Views\App_GlobalResources\WebApp.designer.cs">
<Link>WebApp.designer.cs</Link>
</Compile>
</ItemGroup>
</Project>