How to get local app.config path for a .NET COM object used in aspx page

Hi all,

We have an application with two parts:

- An ASP.NET 2.0 web site
- A VB.NET 2.0 class library (dll) which is compiled to be a COM component, so the public classes have a COM classid for each one.

Most of the operations in the web site are run in the server (in the normal asp.net way), but a few operations have to be run locally in the client PCs which are running the web browser. To allow this, we use COM: we place <object> elements in the aspx pages, with the classids of the right library class. We install some files in the client PCs, including a local app.config file to store some appsettings: user names, passwords, etc.

The problem is that at run time we can't get the path of the local app.config file as the process that "throws" the COM components is the web browser (we can only get the web browser .exe path, which is not the one we need).

So my question is: is there any way in an aspx page to get at run time the path of a .NET COM component installed in the client, so we can find the app.config file? Perhaps it could be done with javascript, but it looks like it will have security issues.

By now we have hard-coded the local app.config file path in the application, which is not a good practice as it forces the client component installation path to be the same for all clients.

Thanks and regards.

Diana

0
diana_fg
6/25/2007 11:46:22 AM
asp.net.config-deploy 12495 articles. 0 followers. Follow

5 Replies
1175 Views

Similar Articles

[PageSpeed] 6

Hi,

First, I from Brazil. Excuse if my way of writing to be confuse. I would use a different way: in first using, the client application consults a WebService to gets the configuration of current user. The same client application configures your own app.config.
0
mgodoy_desenv
6/25/2007 1:05:08 PM

u have 2 options/concerns:

1.1. Add the site in the Trusted list using IE options

1.2. use caspol or mscorcfg.msc to set for trusted code group the permission set Everything or FullTrust

2.1 Use Meta tags to specify the URL to the app.config file which is on the server (i recommend u this) - i don't know exact grammar right now, but in few hours i will post this.

 Any case make sure that u set proper rights in caspol for the hosted control 2 run corectly

 


Yours,
Popa D. Stelian
MCP/MCAD/MCSD
www.simplusoft.net co-founder
ROMANIA
0
stelianx
6/25/2007 3:24:41 PM

i think that this approach is not elegant. This does require to set SocketPermission for the assembly using caspl. And is somewhat more xpensive than having the app.config at a URL on the same server that serves the hosted control.


Yours,
Popa D. Stelian
MCP/MCAD/MCSD
www.simplusoft.net co-founder
ROMANIA
0
stelianx
6/25/2007 3:27:18 PM

Hi,

This way is better than hard-coding the path, but there is a problem as users may have installed the client app in any path (by default the installation path is the Program Files folder, but it can be changed). Moreover, a user can run the application from different client PCs (we don't use Windows authentication), so I can not store the installation path by user.

Anyway, right now the application doesn't work with a client installation folder different than the default one in Program Files, so the web service would be an improvement.

Thanks,

Diana

0
diana_fg
8/10/2007 8:38:54 AM

Hi,

This way is better than hard-coding the path, but there is a problem as users may have installed the client app in any path (by default the installation path is the Program Files folder, but it can be changed). Moreover, a user can run the application from different client PCs (we don't use Windows authentication), so I can not store the installation path by user.

Anyway, right now the application doesn't work with a client installation folder different than the default one in Program Files, so the web service would be an improvement.

Thanks,

Diana

0
diana_fg
8/10/2007 8:46:48 AM
Reply:

Similar Artilces:

[PATCH lib/Net/Config.pm, MANIFEST, t/lib/Mock/Socket.pm, lib/Net/Config.t] Add Tests for Net::Config
Here's a test suite for Net::Config. In the process of writing this, I've fixed an apparent bug that prevented single values from becoming array references when necessary. I think it's right, but perhaps Graham should weigh in on this. In the process, with some advice from perl-qa, I've added a mock object so the test could control the output of Socket::inet_ntoa() and Socket::inet_aton(). t/lib/Mock/ seemed like as good a place as any. I'm happy to rework this patch if it personally offends anyone whose opinion matters. :) -- c --- lib/Net/~Config.pm S...

How to get new web app to use .NET 2.0 on Win2K server using .NET 1.1 as default framework?
I have .net framework1.1 and 2.0 on our server running win2K. i have existing applications that uses asp.net 1.1, i also have a new app that use ASP.net 2.0.  how can i set my new .NET 2.0 app to point to asp.net 2.0 without messing up my existing .NET 1.1 apps? To specify the ASP .Net version fro a web application, do the followingIn IIS Manager select the web application -> Properties -> ASP.Net TabSelect  ASP.Net version you want to use for the applicationRegards,PrashantDont forget to click "Mark as Answer" on the post that helped you. But I am running Win2K...

[PATCH] Net::FTP
I'm playing around with fetching things from the CPAN shell here. We have an FTP and an HTTP proxy here. While stepping through things in the debugger, I notice that Net::FTP::new loads $fire from $arg{Firewall} || $ENV{FTP_FIREWALL} || $NetConfig{ftp_firewall} || undef; $fire_type is initialised similarly but %NetConfig is not consulted. Is this deliberate? If not, I suggest the following patch: --- /home/pne/tmp/install/perl-5.8.0/lib/Net/FTP.pm Sat Jun 1 19:03:20 2002 +++ /home/pne/lib/perl5/5.8.0/Net/FTP.pm Tue Jan 28 11:29:10 2003 @@ -70,6 +70,7 @@ delete $arg{Po...

.NET 2.0 encryption web.config/app.config options?
Situation: 13 servers containing both ASP .Net web sites and .NET apps. Servers are broken up in Developemnt, Test, and Production types.Issue: Need to encrypt all app.config and web.config files.Currently we are using .NET 1.1, so I had developed (test working, not yet deployed) a shared (GAC) utility that would be responsible for providing an interface to allow the encryption (DPAPI + Second Entropy) of information for the developer to manually place in each web.conf/app.config file during development. The backend of this utility was referenced by the *.config files in decrypting values on...

After migration from .Net 1.1 to .Net 3.5 do I have to incorporate new web.config settings in old *.config file
Hi,I have successfully migrated web application from .Net 1.1 to .Net 3.5. Could you let me know whether I have to incorporate setting in new web.config (this new web.config file was generated automatically due to migration) into old *.config file?FYI: Old *.config file contains all application level settings required. So I will continue to use old.config file by removing new web.config file. Settings which are in new web.config file are:<configSections><sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup,...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

Develop in .NET 3.5...Deploy on .NET 3.0...Assembly strong name issue in web.config
Hi. I develop locally using web developer express 2008. I have .NET 3.5 installed on the development machine.I am trying to deploy to a Windows Server 2003 machine running.NET 3.0.Not surprisingly, I get an error about the strong assembly names referenced all over my web.config when I try to access the site on the production server.I don't think any of my code truly relies on .NET 3.5--it should all be compatible with the 3.0 framework.Here's my error message:Parser Error Message: Could not load file or assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77...

Setting & Getting profile information from a .net console app.config file
Hi There, I am creating a windows app for our developer who will be populating user account information over to our website. I thought the best way to do this would be to follow the .net membership provider model and to use it's interface into the asp.net roles/ user database as created via the aspnet_regsql.exe script. From the console app, I can create a user without a problem via the Membership.CreateUser() method, however I can not populate any of the profile properties (i.e. Profile does not even appear as a class that can be referenced even though I am referencing System.Web.Prof...

[PATCH utils/h2xs.PL] use Config; use Config; require Config;
I happened to notice h2xs was using Config.pm a bunch of times. This removes the duplicates. --- utils/h2xs.PL 2002/03/03 18:31:12 1.1 +++ utils/h2xs.PL 2002/03/03 18:31:25 @@ -688,7 +688,6 @@ my $module = $opt_n; if( @path_h ){ - use Config; use File::Spec; my @paths; my $pre_sub_tri_graphs = 1; @@ -867,7 +866,6 @@ } open(XS, ">$modfname.xs") || die "Can't create $ext$modpname/$modfname.xs: $!\n"; if ($opt_x) { - require Config; # Run-time directive warn "Scanning typemaps...\n"; get_typem...

app.config and web.config deployments and installers
I use web deployment projects for changing web.config values based on the configuration build types I have setup (dev/test/stage/prod) and it works excellent for building installers in multiple environments.  Now, I am trying to do the same the Windows Applications.  How can I automate the changing of app.config values based on the build configuration (dev/test/stage/prod)?  Any help would be much appreciated. Thanks,Chris...

Deploying .Net application with datawindow .Net objects
Hi I=92ve been testing datawindow .net for our company by building a small working application using the Datawindow .Net tutorial. It works great (both from the VS interface and the compiled solution .exe) and was easy to create. My next test is to try and deploy this application to another machine, which has the .Net (1.1) environment but no Powerbuilder or Visual Studio. I built my solution and placed these files, all in one folder, on this other machine: datawindow.dll datawindow.xml DataWindowInterop.dll MSVCP71.DLL MSVCR71.DLL PBDATA100.dll PBDWN100.DLL PBO10100.D...

.net 2 virtual app login still uses root parent app for .net membership
 Hi, I  have a folder on a primary site that I want to have its own separate login. In aspnet membership - the appllication name will be unique, as will be the users. I edited the parent web config and set all the appsetting, connectionstring, system.web and system.net sections to have enclosing location tags as shown below <location inheritInChildApplications="false">  So that those sections would not be inherited by the child folder/virtual directory.  Then I was able to put a separate web config, with its own connection string and .net me...

Both C# ASPX pages and VB.NET ASPX in single VB.NET Web Applcation Template
Hi.. Is it possible to have both c# pages and VB pages in same Webapplication, what i chose is VB.NET Web application Template. With Thanks, Jaya.... I don't see why you couldn't, but for the sake of consistency I don't know why you would want to do this. When you choose a C# or VB.NET application template(I'm assuming you're using VS or WebMatrix), it simply creates a .aspx file that includes a page directive that specifies the page language. If you created a C# template but want to use VB.Net instead, you need to go from: <%@ Page Language="C#" .... to...

App.Config in a Class Library... Object Returns Null When Used in App
In my data tier, I'm using an App.Config file to store stuff, and I've created a class in the data tier project to access its resources. In my class I have the following: /// <summary> /// get's the resources connection string /// </summary> public string ConnectionString { get { //TO DO: Have class return decrypted connection string return ConfigurationSettings.AppSettings["ConnectionStringName"]; } } For some reason, this property is always returing null, but my app.config file has the ConnectionStringName key/value pair in t...

Web resources about - How to get local app.config path for a .NET COM object used in aspx page - asp.net.config-deploy

Proxy auto-config - Wikipedia, the free encyclopedia
Computer operating systems (e.g., Microsoft Windows , Mac OS X , Linux ) require a number of settings to communicate over the Internet . These ...

Platform Updates: New Industry Pages, Refreshed Services Status Page, and New Parse Config Dashboard
Platform Updates: New Industry Pages, Refreshed Services Status Page, and New Parse Config Dashboard

App Config for Android - YouTube
Free version: https://play.google.com/store/apps/details?id=fi.aarosoft.appconfig.free Full version: https://play.google.com/store/apps/deta ...

HP unveils cloud config manager
HP this week unveiled a network virtualization system for large enterprise and cloud providers designed to simplify network configuration.

China configs 'firewall' against official meddling in judicial cases
China configs 'firewall' against official meddling in judicial cases

Group criticizes Apple’s removal of IPv6 in Airport config tool
Back in January of this year Apple released AirPort Utility 6.0 , an updated version of the configuration tool for setting up home networks and ...

System Software: Configs for Mac 128K, XL, 512, & 512KE (7/94)
Macintosh 128K Currently ships with: Product no longer available. Supports: System 2.0 and Finder 4.1. Recommended: System 2.0 and Finder 4.1. ...

Free 32GB Apple TV and $60-$111 discounts on iMac 4Ks & iMac 5Ks, plus $150 coupons on all custom configs ...
Whether you want a free Apple TV plus discounts, a free AppleCare extended protection plan plus discounts, or just the lowest prices anywhere ...

Dell releases updated XPS-13 Developer Edition in wide variety of configs
... is available immediately in North America and Europe. According to Dell’s announcement blog post , there is a wide variety of possible configurations ...

Config error at Boston-area hosting company takes down Reddit, others
... hosting provider briefly knocked several large services and websites dependent on Amazon and AWS offline on Tuesday night, thanks to a configuration ...

Resources last updated: 12/13/2015 9:47:20 AM