vsuneel

hai guys,

this problem is making a head- ache to me...

i have built a console application in the .net1.1 with vs 2003.its working fine while debugging or running.even its working  fine by running the .exe file directly when it is in bin folder.

but if i take out the exe file and running out side the bin folder...its showing err.

it is showing a nullreference error saying that the connection string(database) is not passed..actually i have passed the connection string..thirough app.config  file.

this time..i have brought .exe.config file to the same location.now it is showing the "applicationblocks.dll is missing." even though  i add reference.

if i taken the entire bin its working fine in my system...but the same bin if i taken to

another system which is in net work its showing system.security.Securityexception

so, in evry step its hitting me...

how to solve this problem... i couldnt make it!!

please help..me....

suneel.




Re: .NET Base Class Library My .exe file is not running outside bin folder??

TaylorMichaelL

To deploy your app all binaries contained in the bin directory along with your configuration file will need to be copied to the target directory. References are strictly for the compiler. At runtime the CLR still needs to have access to them.

As for the security exception I'd wager it is a problem with your config file or the user running the app. Try checking the security settings for the machine to make sure the user has access to whatever you're trying to access (database or whatever).

Michael Taylor - 2/16/07
http://p3net.mvps.org





Re: .NET Base Class Library My .exe file is not running outside bin folder??

vsuneel

thank u very much MichaelL,

 but as for the security exception...i have given full access to the folder(bin)...still which access settings i need to check

and i have even tried by removing the config file and writing evrything inside the application itself.

its giving the exception as...

Request for the permission of system.data.sqlclient.sqlclientpermission has failed .

what is this i have given evry reference...why the permissions are making a prob

please reply me.

thank you.






Re: .NET Base Class Library My .exe file is not running outside bin folder??

TaylorMichaelL

This is a CAS problem. Your application does not have the necessary permissions to access your DB because of CAS. Refer to MSDN on the permissions managed by the SqlClientPermission. It sort of sounds like either you are not a fully trusted app or someone has locked the app down. You can use permcalc from the .NET SDK and the Configuration Wizard (mmc snap-in for .NET) to determine what permissions are in play. Specifically with the Configuration Wizard you can determine the current machine-level policies in place and view the permissions for your assembly.

Are you trying to run your app across a network, UNC path or mapped drive If so then this may be causing you problems.

Michael Taylor - 2/17/07
http://p3net.mvps.org