Publishing Website Errors

ivonsurf123

New member
Joined
Sep 13, 2024
Messages
3
Programming Experience
Beginner
Hello,

I just have a question that I cannot find in Google, but I have this website that brings photos through a path that I have built in the code like this:

CODE:

// Base path configurable
string baseImagePath = ConfigurationManager.AppSettings["ImageBasePath"] ?? @"\\WCUPOBPROC1-A\Old_Check_Images";

When I run it in my local computer, it works perfectly and the path that shows in the web browser is this:

https://localhost:44339/Images.aspx

But now that I have published in the server to go Live as a website, It is not working and the path in the browser is:

https://fnweb.wescom.org/Old_Check_Images/Images.aspx

But It gave me a few errors:

Error 404:

Error occurred on recovery Image: Error 404:

no-image.png:1

GET https://fnweb.wescom.org/Old_Check_Images/no-image.png 404 (Not Found)

Any help to resolve this issue will be appreciate it. Thank you.
 
Moving to ASP.NET...

You need to understand the code that you have written. If you didn't write the code, you need to ask the person from whom you took the code from. Your code has a null value handler that lets it fall back to a different value if the setting is null.

Either you have the hosting site a bad web.config file, or the hosting site modified the web.config to something different from what your have them. I either case, IIS could not find the "ImageBasePath" in the <appSettings> section of the web.config file, and so your code is falling back to your null handler.
 
*sigh* It would be helpful if you provided here the details that you provided in your Reddit cross-post of this same question.

Of note from your Reddit post:
All the photos are in this path: \\WCUPOBPROC1-A\Old_Check_Images

What I do is create the path and when insert the specific variables start building the path and after building the correct path, then start the searching. It does work perfectly in my local, but when i publish it to this site;

If the code is running on the web server that presumably is hosted on another machine, does that machine have access to the machine "WCUPOBPROC1-A" ? Does the app pool identity hosting your app have permissions to the file share: "\\WCUPOBPROC1-A\Old_Check_Images"?

You also mentioned that you are doing some path processing. It would help if you add some logging so that you can figure out what the initial baseImagePath value is, and the new values as you do that processing to end up with your resultant path. That will give you the most information about what is going on. You will be able to look at the logs to see what reality is as compared to your expected values. That's how debugging works -- tracing code paths and variable values. Debugging is not "run it and see if it looks right".
 
Is this the reason you open or join this forum? To mocked beginners and juniors developers? All that you have done in your two comments were just insulting and questioning me if that is my code or not but just providing helpful insights to start searching or investigating. I exhaust all the ways that I can think of before I post anything on any forum. I may not be perfect and know it all as you do apparently, but I try to built something every month through Udemy classes and any other classes I can find about programming, since nobody has the luck you have had on getting a job in programming after college to practice with Live events, at least I keep trying by practicing until I get that opportunity.

And yes, an error log will be helpful since I cannot debug a publish website but I can only observe the console on inspect for errors. And I do not do what you probably think of every programmer women , we treat debugging like playing dolls as you say it in your own words: "Debugging is not "run it and see if it looks right"

AND if you manage this forum, take me out of here since I cannot do it. I do not need your BS.
 
Kudos to you for continuing to practice and improve! I wish everybody was trying to do that! Keep on working on it and add to your portfolio to either show or discuss in your interviews. You are on the right track!

My first comments were not meant to be insulting or mocking. They were meant in all seriousness. If you used the ?? operator, then that would meant that you did it deliberately and should know about what kind of impact it would have in your code. If on the other hand, you just copied the code from someone else and took the the use of the ?? on blind faith, then you would need to understand why it was used and what effect it would have.

I didn't even know you were a woman programmer. My comment about "run it and see if it looks right" is from years of participating in forums like this where various posters would say that they have spent countless hours "debugging" their code, but when asked specific details, it comes out that their were actually just running their code, rather than debugging their code. So my comment was just applying generically to everybody says they were "debugging", but not showing any evidence of trying to trace through the logic and values of their code.

For logging, there's no need to log just to the console. You can use log4net or various other logging libraries to write out to a file, database, Windows event log, or email. If you don't have direct access to web host and you log out to a file, does the web host have a support intake where you can request that they send the log file back to you? Or does the web host provide FTP access so that you can download the file yourself? (There was one system I once worked on which didn't provide any of these and I was forced to write all my logging into a hidden label field. That was a painful way to debug.)

I'm sorry if you want to leave the forum, but please do persist with the art and science of coding. We need more female programmers. I've worked with several brilliant female programmers. They brought the extra element of patience and attention to detail to higher levels.
 
Back
Top Bottom