Deploying website, error points to file on local pc, using Visual Studio 2012 - asp.net

I've created a website in Visual Studio 2012, now when I upload my files to the web server I receive an error whereby the system cannot find the file specified.
It seems to only happen on files which fetch data from a database.
I've tested my connection string and that seems to be working as I've close the connection as well as deleted the local db I was using. My site works fine when run locally, but the second I try access it online I get the same error.
Link to error image:- http://imgur.com/wkXV8fe
I've highlighted the error that puzzles me in the image. It keeps trying to find the file on my local pc it seems. I've searched through my code and can't seem to find anything that is hard coded.
Your help is much appreciated, hopefully someone has encountered and solved this problem.

The possible reason are,
The folder which containing specified file is may be read only or admin access or hidden in server machine. If possible, check the folder properties.
Make sure the file containing folder has uploaded or not on server.
It won't find your local pc if you hosted on other IP(server). The same root folder may be present on server side, so don't get confuse with server and local machine.

The "file not found" error is actually misleading, the error you need to deal with is the SqlException error and indicates the connection string is wrong - you need to update the connection string to access the SQL Server externally.
Are you also deploying the database to another server or are you attempting to access the same database as when testing locally? If you are accessing the same database locally, make sure the web server you are using to host the website can actually access the SQL Server on your local machine - check all firewalls and other things, and make sure that the SQL Server accepts TCP connections.

Related

ASP.Net Server Debugging

I am having a problem with my application. The application works perfect on my development machine. It fails, without any errors on the live server. The page loads, but the code doesn't execute apparently.
I have been stuck on this for a while because I can't figure out how to get any information on the problem. There are no errors, so my custom errors settings in web.config are not helping.
I looked around online and I heard there was some remote debugging tool. The article was from .Net 1.0. I tried to follow it, but its not going to work because I am using a shared server. I do not have permissions to start the remote debugger on the server side.
I tried creating some output text files with variable contents, but the files are not being created either. They are created on my development machine, but never show up on the server, again with no error.
I have no idea how I'm supposed to figure out what is going on, because I'm not able to step through the code once it's on the live server.
Is there anyway to step through, or debug the code once I've published it? If I spent the extra money on a VPS, would that allow me to debug on the server side? I'm assuming I could just install Visual Studio on the VPS and step through the program. I've never used a VPS before.
Unless you do something very special in your code, it is unlikely that it behaves differently on your server compared to your workstation.
It is more likely that the configuration on the server is not correct.
You are saying your
code doesn't execute
How do you know that? You should first confirm that your code is actually executing.
you are also saying:
it is now directing me to a page that says "Directory Not Found"
a web server it never looking for directories, it is looking for resources, check your iis http logs what substatus codes are you getting?, enable Failed Request Tracing and review the logs.
Using Process Monitor can also help determine what the web server is doing.
Start with a very simple page and see whether that executes fine.
What I'm saying is, first debug/fix the execution environment before trying to debug your code.
You would never install Visual Studio on a server, the default installation of a Windows Server doesn't even allow you to install it. Instead you can use remote debugging components on the server and use your local Visual Studio to debug remotely.

OLEDDB and web server

Okay, I have a problem with OLEDB. I have install the "AccessDataBaseEngine.exe" and I am able to upload an Excel file to a Gridview on my local server. When I try to upload on my online web application (With Windows Azure) I get the following error: "The 'Microsoft.ACE.OLEDB.1.0' provider is not registered on the local machine." It does not make any sense to me as to why it does not work and after searching the web everyone suggests to install the AccessDataBaseEngine 2007 (which i did) and as mentioned above it works only on the local server. Anyone knows how to resolve this?
Thanks in Advance.

Sql Server Error 26 Local

(The database is on my PC)
My database worked just fine for a month, and then this error came. It is not related to a specific file, nor a specific project (Even if I'll create a new website and try to add a new database file, this error will pop)
I guess it happens because the sql server is not running on my PC, and it is true that I don't see any sql related process running.
How the I fix it?
P.S. I know this error has a lot of threads on the internet and even here in SO. But most of them solve the problem for a complicated, secured connection with a remote server. All I want is to create a new empty ASP.NET website and add a new .mdf file for it on my PC.
It may be related with the SQL Service authentication which you have to verify from the control panel->Administrative tools->Services. Locate SQL Server(Express) Try changing the Log on As Network Service instead of local system.
that is a error Locating Server or Instance.
Try connecting by IP.
Have you disabled SQL Server browser?
I was facing something similar so I will share how I solved it, it might work for you or not, but here are my 2 cents.
My environment: Windows 10 ( upgraded from windows 8 in which SQL Server was working fine)
SQL Server 2014 Express
Solution: I Opened the services program, and found the SQL Server services, I saw that all of of them were up except by one which was disabled, the "SQL Server Agent", I enabled it and was able to connect to my DB instance.
Hope it helps
Regards

Using database on another development machine

I am developing an ASP.NET website. I wanted to shift whole of my work to another PC of mine. I copied the website to the other PC>Open>Create ASP.NET folder>App_Data
and pasted the database.mdf and database.ldf files there. I was getting some exception when I was trying to run the website as it showed the "could not open the connection from con.open()". Is there some other step too that I am missing?
Sql Server database files are not like any simple html files that can be copied between machines. You need to make sure that the database that is getting served up: e.g. there is a Sql Server instance running that can present the database to your web application.
Here's an article on how to attach an mdf file to a Sql Server.
You need to attach the mdf and ldf files to the sql server instance on the target machine. You may need to adjust your connection string as well, unless you used a local name reference like "." for the data source.
What is your connection string? Chances are the path in the connection string has the local path to the database file on your original development machine.

Problem connecting to Oracle database via ASP.NET page under IIS

I'm having a problem getting a simple ASP.NET webpage to display. The page contains a GridView with a SqlDataSource connected to an Oracle database.
When I run the page in the VS debugger (cassini webserver) everything works fine, but when I publish the application to my local IIS server (same machine), I get the following error:
ORA-12154: TNS:could not resolve the connect identifier specified
If it was a different machine I could understand that it might be a tnsnames.ora or other problem that I could investigate via tnsping. I have also set the security on the folder containing the Oracle drivers to "Everybody", and set the webapp to run under a "Priviliged" AppPool (Identity as Administrator), but with no success.
Anyone else got any ideas??
this guide is a bible for this kinds of problems :)
Actually i have printed one copy of this guide and distribute it to every consultant involved with IIS ASP.NET to ORACLE connectivity issues. The checklist will probably get your problem solved, unless you have a problem within your code which you don't seem to have based on your scenario.
I think you more than 1 Oracle client. You need to search ALL your tnsnames.ora files with the windows explorer and compare and synchronize ALL those files.
maybe you need to specify the IP

Resources