.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

How to restrict runtime to load dlls from bin folder only and not look elsewhere

Posted By:      Posted Date: September 11, 2010    Points: 0   Category :.NET Framework
 
Hi, How do I restrict runtime to see only bin folder to load two specific dlls To explain the scenario better, I need my windows application to communicate with MQ server. But my constraint is that I do not want the users of the application to load MQ Client. For this I extracted two dlls from MQ client and included in my project's bin folder and tried to conect to MQ server. It works perfectly fine if there is no MQ Client installed on the machine. But if any version of MQ Client is present on the machine, it fails. I believe it is trying to read from the dlls present on the machine instead of reading it from bin folder and it fails for some of the older version which did not supported .NET calls. I would want to restrict the runtime to read only two dlls and not go to load other dlls if it finds MQ Client installed.   Can <assemblybind> or probing method help me in this? If so, how to include it in my config file.        


View Complete Post


More Related Resource Links

How can I restrict runtime to look for dlls in only bin folder

  
Hi, How do I restrict runtime to see only bin folder to load two specific dlls To explain the scenario better, I need my windows application to communicate with MQ server. But my constraint is that I do not want the users of the application to load MQ Client. For this I extracted two dlls from MQ client and included in my project's bin folder and tried to conect to MQ server. It works perfectly fine if there is no MQ Client installed on the machine. But if any version of MQ Client is present on the machine, it fails. I believe it is trying to read from the dlls present on the machine instead of reading it from bin folder and it fails for some of the older version which did not supported .NET calls. I would want to restrict the runtime to read only two dlls and not go to load other dlls if it finds MQ Client installed.   Can <assemblybind> or probing method help me in this? If so, how to include it in my config file.          

How to restrict folder access to users and theirs only

  

Hi. I created a web application using "Forms Authentication". 

There is a folder name "uploads", and it creates subfolders as username when they register. Web application stores users' files and images under their folder ("uploads/username")

I tried to find a way to restrict users to download and upload files to their folder only and couldn't find a good one. 

Then I came up with this idea that stores "web.config" file each time user registers and the web.config should look like below. Username will be changed dynamically according to username.

This method actually works but I am little worried if this is a good practice as far as performance wise. Because it'll create web.config files as many as users and there might be other holes that I don't recognize. 

I appreciate any advice or better suggestion for this problem.


--------web.config in "/Root/uploads/username directory"--------------

<location path="HRpages">
  <system.web> 

How to load a usercontrol xaml at runtime ???????

  
Hi, I have a usercontrol xaml created in Expression Blend. Similarly i have xaml for other usercontrols as well. Now i want to draw these controls at runtime on click of buttons, the way it works in VS IDE (Toolbox and Drawing area) Is there any way to load such usercontrols on Canvas at runtime ? What would be the best way to load controls at runtime ?      Programmer

Can't Load 32-bit Com Object into managed code (C#) in runtime with 64-bit Enviroment

  
Hey everyoneI need your help with some 64-bit issues. I recently had to migrate my work to a 64-bit enviroment.  I'm using VS 2005.I have a simple c# application that is using an unmanaged c++ Com object. both are 32-bit applicationsBoth projects compile smoothly, and when i register my com object it succeeds. However, during runtime when i try to create an instance of the com class: 'someComClass a = new someComClass()' I get the error:COMException : Retrieving the COM class factory for component with CLSID {XXXXXXXXX} failed due to the following error: 80040154OK people, bring it on, what's wrong ? how do i fix it ? registery issues ? compiler issues ?Any help is welcomedWith thanksOded

AppDomain to Load and Manage DLLs

  
My question/situation is with regard to AppDomain.CreateInstanceFrom or AppDomain.CreateInstanceFromAndUnwrap or AppDomain capabilities.My customer wants a service (or application) that can invoke Public methods from any .NET Managed DLL and be able to add, change, rename, delete those DLLs out of their storage location while the service is running.  DLLs will mostly likely not be marked Serializable and will most likely not inherit from MarshalByRefObject.  Presently, I am providing this functionality without the ability to change, rename, or delete DLLs while the service is running by loading the DLLs at service start (not very memory friendly).Could I create a manager class that supports this functionality, load that class into a separate AppDomain, invoke methods as needed, and unload the AppDomain as needed when DLLs change?  I would manage execution with a Queue object to ensure that requests for invocation don't get lost and don't try to access the manager when it is no longer in scope.  A FileSystemWatcher would handle unloading the AppDomain when changes occurred.Does this sound correct, normal, abnormal, or not possible?Software Developer, Augusta Systems

Assembly load error system.runtime.serialization

  
Hello ! I have a web project which i began there is some month, and compile perfectly until now. In fact, i have some compile error;   erreur 1 Could not load file or assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The module was expected to contain an assembly manifest.   on explorer :   The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) Description : Une exception non gérée s'est produite au moment de l'exécution de la demande Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code. Détails de l'exception: System.BadImageFormatException: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) Erreur source: Une exception non gérée s'est produite lors de l'exécution de la demande Web actuelle. Les informations relatives à l'origine et l'emplacement de l'exception peuvent être identifiées en utilisant la trace de la pile d'exception ci-dessous. Trace de la pile: [BadImageFormatException: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)] System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBa

SSIS FOR each loop to load 1 file after other into database for particaular folder

  
HI I am using ssis 2008,i have folder in which i have 10 excel file.i wont to load them one after other in data  base I have created a Dataflow task that load one file into database.i have inserted this dataflow task into For each loop and in For each loop i have give that folder path and *.XLSX  and in variable mapping i have created one variable  which i have passed in Database destination connecion string (properties->expression) but still i get error "cannot acquire connection from connection manager" please guide me or provide me with some reference so that i cud load file from folder into database one after other

Cannot load resources: Inconsitancies during desgn- runtime packuris.

  
I've a small problem regarding pack-uri's in my application, this involves inconsistencies during runtime and design time. During design-time I am able to use relative uri - what i presume to be relative to local assembly i.e. pack://application:,,,/Resources/add_small.png but during runtime the image is never displayed. I've found a way to work around this matter by referencing the assembly itself in the uri i.e. pack://application:,,,/BluewaterFishing.Package.Basic;component/Resources/add_small.png Recently I've been trying out visfire products as a charting solution and I stumble on the same type of constancies between design- and run-time. During design time the charts display normally and during runtime a exception is thrown "A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll. Additional information: Set property 'System.Windows.FrameworkTemplate.Template' threw an exception." In terms of product setup, I'm closely following the traditional Microsoft conventions as seen in their products: Visual Studio, Exchange Server. I'm using the following path layout seen below. In my application I'm using the main executable as a boot-strapper for the different modules. The problems occur in such a module. $(InstallDir)/Project.exe $(InstallDir)/Data.1/ $(InstallDir)/Data.2/ $(InstallDir)/Private A

How would runtime determine which assembly to load?

  
Hi , How would runtime behave, if I have an assembly with same version number in two different folders on my machine? How to restrict the runtime to read from bin folder only for my specific assembly?        

Restrict folder access in Report Server

  
Hi There, I am creating folders each of our end users in Report Server, who upload their reports to their respective folder. I want to allow users to see and access only their folders and they should not be able to see others folders available on the Report Server, it is possible? If Yes, how do I do it? Thanks for your help. Regards, Suresh

restrict access for a single group to a single folder in a list

  

Hello and Goodmorning,

I have one list, organized with 3 folders.

I can create a group(s), add user(s) to this group(s). 

Now i need to assign access like this:  group1 can only see and 'readonly' folder1, group2 can only see and 'readonly' folder2, group3 can only see and 'readonly'...folder3!

Im sure this is possible, from similar non-programming posts on the forum.

I have been looking into SPRoleAssignment and SPRoleDefinition to define Group permissions but its the mapping them to specific folders that I am missing...

Enjoy your tea.

 

max

 

 

 

 


Unable to load current sub site's images from Sitecollectionimages folder

  

I am Unable to load current sub site's images from Sitecollectionimages folder

I have used the same master page all through the site for testing, I have used

../../SitecollectionImages/test.jpg

I have resources Site, it works fine, Now I create a HR site under resources and Benefits sites under HR Site, I apply the same master page, my banner and footer images is not rendering, can someone please provide me a hint on how to point to the sitecollectionimages folder, is ../../ rightway to point to the folder or can i register a root and use that the pointing to the right folder.

I have a publishing site, It is on an vm, I am the admin for the site

Thank you

Neel


Putting dlls on web-site's assembly folder.

  

Hello.

How can I put my own dlls on the web-site in the hosting assembly folder,

if I hire an hosting space on some computers  on the internet.

 

i.e : Using Plex, for Windows 7, Framework 3.5, ASP.NET.

 

Thanks :)


How to load "Database Instance" for "Database Trace Listener" at runtime

  

Hello,

I have been searching for a while now without success. On how when using EntLib 5.0 Logging, Data; to be able to set the database (i.e. the connection string) at runtime for a Database Trace Listener. The reason being we will have the same configurations on all levels of the environments (dev, test, stage, prod), but the connection string is different for each and we do not store the connection string data in the config file. The connection string data is loaded using a custom configuration manager for security reasons.

 

Any help and any code sample much appreciated. 

Thanks, 

Jeff


Could not load file or assembly '' or one of its dependencies. This assembly is built by a runtime

  

Could not load file or assembly '' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

 

Can anybody pls help me how to resolve the above error !!!!

Rgrds//Praveen


Thanks in Advance !!! Cheers !!! Praveen Mandalapu

Enumerating through dll's in a folder and load them with REFLECTION

  

Hello guys,

Am trying out something new.

 

I want to

1. enumerate though the available dll files in a folder and using this code.

2. Dynamically load them with reflection

 

// GEt all the dll files

 

private const string dir = @"\mydir";

How do that .Net project runtime determine load which assembly

  
I have a .Net 2.0 prject , and need call .Net3.5 assembly. If the machine set up .net3.5, it can work;  otherwise it will throw exception. Now I want to prepair two aseembly, .net2.0 and .net3.5. They are same source and IO, but .net2.0 disable some .net3.5 functions. When I found the machine doesn't support .net3.5, I call the .net2.0 aseembly. How do it? 

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend