I have a VPN in my office. One machine has windows server 2003 installed. I am coding an app in C# to upload files from a machine connected to the server machine on a shared folder.
The file transfer code has been written, but it throw Access denied exception when I run it.
However when I open the shared folder using windows explorer and key in my username and password, then it works like a charm.
I need to know why it's throwing this exception and what code should I write to automatically authenticate myself from the code without going to windows explorer and entering credentials there.
Update --
.net version is 2.0, I can upgrade if its necessary but I dont think its the issue.
Iam running the application on the local machine.
I solved the issue using impersonation.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306158
http://www.codeproject.com/KB/cs/cpimpersonation1.aspx
Related
I have made a desktop app Setup that connects with remote Oracle 10g Database. When I install Setup on remote machine and run my application then I get following error:
system.data.oracleclient requires oracle client software version 8.1.7 or greater
It works well on my Development machine.
It is a security issue, so to fix it simply do the following:
Go to the Oracle Client folder.
Right Click on the folder.
On security Tab, Add "Authenticated Users" and give this account Read & Execute permission.
Apply this security for all folders, Subfolders and Files (IMPORTANT).
Don't Forget to REBOOT your Machine; if you forgot to do this you will still face the same problem unless you restart your machine.
http://blogs.msdn.com/b/fabdulwahab/archive/2011/11/13/system-data-oracleclient-requires-oracle-client-software-version-8-1-7-or-greater.aspx
The error message is pretty self-explanatory: your application needs the Oracle Client installed on the machine it's running on. Your development PC already has it. Make sure your target PC has it, too.
Edit: The System.Data.OracleClient namespace is deprecated. Make sure you use the driver native to your database system, that would be ODP.NET from Oracle.
Install Nuget for Oracle.ManagedDataAccess
Make sure you are using header for Oracle:
using Oracle.ManagedDataAccess.Client;
This Worked for me.
On your remote machine, System.Data.OracleClient need access to some of the oracle dll which are not part of .Net. Solutions:
Install Oracle Client , and add bin location to Path environment varaible of windows
OR
Copy
oraociicus10.dll (Basic-Lite version) or aociei10.dll (Basic version),
oci.dll, orannzsbb10.dll and oraocci10.dll from oracle client installable folder to bin folder of application so that application is able to find required dll
On your local machine most probably path to Oracle Client is already added in Path environment variable to there required dll are available to application but not on remote machine
If you have to use the older client, here is my experience.
We are running a 32bit server so the development machines run the 32bit client. We run the 11.1 install, 11.2 gets the error. Once you have installed the 11.2 version you have to manually delete the files Oracle.Web.dll and System.Data.OracleClient.dll from the %windir%\Microsoft.NET\Framework\v2.0.50727, reinstall 11.1, then register the dlls with gacutil.exe.
This fixed the issue with my systems.
Go to C:\app\insolution\product\11.2.0\client_1\BIN and find oci.dll. Right click on it -->Properties -->Under Security tab, click on Edit -->Then Click on Add Button --> Here add two new users with names IUSR and IIS_IUSRS and give them full controls. That's it.
After installation of Oracle Client 11.02.04, reboot the server and make sure USERS(Local Computer) is added with Full Control on Root folder for eg WWW
Tested, it worked.
This posting is about mostly desktops and this oracle message. I want to talk about server class machines running a dtexec that are throwing this error message. In one case it meant that an installed oracle client instance on a server machine was no longer there, and it had been there for a long time. On the client side we found recently 1/2023 that certain versions of the oracle client 32 bit don't run on a laptop with AMD chips. Downgrading to a lower version of the oracle client 19.x fixed the problem.
I am creating a windows service application to run on a Windows Server 2008. Another windows server 2003 server running on a different live IP exists. Both these servers are from the same providers, and belong to the same network. A shared folder exists on the WS2003 server.
From the Windows Service i am trying to access the shared folder using UNC Path (\Server2003IP\SMSFiles), where it gives error.
if (!System.IO.Directory.Exists(PATH_SMS))
throw new ApplicationException("Could not find or access SMS folder");
The Windows service is installed & I tried giving the Logon as the System Administrator also. But no luck.
FYI - The same scenario by keeping the shared folder on WS 2008 & installed the service on WS 2003 and the whole thing worked fine.
Any Helping Hands Please
After searching online and testing various scenarios, i was able to fix the issue.
Solution: Both the servers should have a user with the same Username & Password and give permissions for the folders. Also run the windows service under this particular Login User.
:-)
Situation: I have web application in my pc, who manipulates docs to generate pdfs with no problem. I configured my dcomcnfg to work fine because I had the problem with access permissions the COM.
The problem: I have to put the website in the server. The server has Win8 Enterprise. Doesn't have Visual Studio installed, only framework 4.0 and the Word Office. When I try to generate pdf it always return this error: Retrieving the COM class factory for component with CLSID ...
I run dcomcnfg and customized all permissions to IIS service (doesn't work and put to) Everyone. I Set all Launch and Activation permissions to allow Everyone, I also set Access Permissions and configuration permissions.. And still don't work.
I have to register the dll in server?(How I do it?)
I need more configurations?
I Have to install all Office?
ps: Office 2013
while it is not recommended to use this on server, there is a possible solution:
impersonate the admin in the asp.net application:
http://msdn.microsoft.com/en-us/library/aa292118%28v=vs.71%29.aspx
it may have security issue.
I am trying to connect to DB2 from .NET 2.0 application in my development machine running windows 7 64 bit.
I am getting this error in open method. Could not find a solution.
ExceptionType: InvalidOperationException
ExceptionMessage: SQL1159 Initialization error with DB2 .NET Data Provider, reason code 2, tokens D:.......................\bin\db2app.dll,
StackTrace: at IBM.Data.DB2.DB2ConnPool.Open(DB2Connection connection, String& szConnectionString, DB2ConnSettings& ppSettings, Object& ppConn)
at IBM.Data.DB2.DB2Connection.Open()
Learnt this from a colleauge of mine. Issue was because db2app.dll was missing in bin directory of application folder.
Copied db2app.dll and db2app64.dll from C:\Program Files\IBM\SQLLIB\BIN to bib folder of application and it worked fine.
See the "user response" at the bottom of the IBM doc for SQL1159N, which also lists the various reasons you might receive this error code:
There was a problem with your DB2 installation. If this is the first time DB2 was installed on this computer, review the install logs for any possible errors and run a repair of DB2 from the Add/Remove Programs control panel applet. The default location of the installation logs is the My Documents/DB2LOG folder of the user that performed the installation. If this does not resolve the issue please contact IBM Support and provide the reason code associated with this message along with any installation logs.
I had a 32 bit DB2 Client and I was accessing it from a Web Application hosted on IIS, using Application pool (with 'Enable 32-bit Application' set to false). In this case a
64 -bit client (db2app64.dll)
is expected while db2app.dll will throw above error.
Just FYI..
It is hard to debug this error in Visual studio as by default IIS express uses 32-bit application pool. To change it to 64-bit, one has to make changes in registry (set Use64BitIISExpress to 1) There is no inetmgr for IIS Express.
After speaking to IBM, they recommend strongly against putting IBM dlls inside the bin folder. We let IBM remotely configure our server and now all works well and we must not put the ibm*.dll into our bin folders or it will not work.
I am working on VS 2010 with .net 4 (OS: Windows XP). I want my application to have update feature. I have only one computer. How can i deploy the application it to test the update feature?
Currently i am publishing my application in a folder in my documents
I tried publishing to local FTP using XAMPP but it was unable to check for updates on FTP.
Now i have installed IIS to make a local HTTP server to deploy my application there but it asks for Front Page Server Extension then was asking Front Page.
All i need is that my application can update it self. Original requirement was patch update but i don't know how to do that. I think using ClickOnce is enough.
Create a network share on your local machine and publish to that; when you install the application, make sure to install it via the network share too.