locked
debug and publish have different outcome RRS feed

  • Question

  • User-146799434 posted

    the nightmare returns for me, please see my previous solved thread: "smtp setup for email from within .aspx instead of config file" 

    the problem in that thread to send email vial google was working when I ran program in vs debug, eg, iis express / vs debugger

    I'm running IIS 10 and created a localhost site for the project and published the project there via a file system publish profile. the publish was successful and  there is an updated programName.dll in the site's bin directory, so at this point I'm assuming its the 'working' compiled .aspx.vb code that runs in the debugger(yes?) however, I'm getting the same dreaded error "System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at"

    so at this point I see 2 possibilities: 1. somehow even though the .dll dates show I'm running the latest and greatest working version from the debugger somehow its the old non working code? or 2. there's some difference in what is actually sent to gmail due it being sent via regular IIS as opposed to IIS express of the debugger?

    I am so hoping this won't take a month to solve like the original problem

     

    Monday, October 9, 2017 8:06 AM

All replies

  • User1771544211 posted

    Hi bbxrider,

    This could happens when you try login from different time zone or IP Address Computer. Your production server and the mail id you have used both are in different time zone. Choose any of the one solution:

    1) Log in to production server via remote access, and sign in to gmail once with your credentials. They will ask for the confirmation, confirm it and log out.

    Or 2) log in gmail to your local computer, Follow this Link and choose review this activity and take proper actions.

    Reference link : https://stackoverflow.com/questions/20906077/gmail-error-the-smtp-server-requires-a-secure-connection-or-the-client-was-not

    Best Regards,

    Jean

    Tuesday, October 10, 2017 2:48 AM
  • User-146799434 posted

    thanks for the reply

    running my IIS 10 website on the same machine as the vs IIS express, should  be the same code, whatever data IIS gets from the host system should be same

    Tuesday, October 10, 2017 6:09 AM
  • User-146799434 posted

    ok for some reason vs publish is not publishing the most recent compiled version of the aspx.vb

    I'm using the file system publish since the IIS 10 target site is on my dev machine, I even changed the publish settings to delete all existing files  as part of the publish trying to make it as comprehensive as possible

    the weird thing is the program.dll and program.pdb both have current modified date/times equal to the publish date time 

    Tuesday, October 10, 2017 7:55 AM
  • User1771544211 posted

    Hi bbxrider,

    Please try create a new publish profile and republish your project. Or you can try publish the content to a new location and add a new website to map to that new location to check if it works.

    If it works when you publish to new location, You can copy the new location's content and replace your original website's content.

    Best Regards,

    Jean

    Tuesday, October 10, 2017 9:35 AM
  • User-146799434 posted

    my results are really crazy not sure at all what could possibly be happening

    my program is working, see post, smtp setup for email from within .aspx instead of config file, ie when running program in debugger email is sent

    (note program writes a log file for production but also very handy for debugging so I can put in messages, etc )

    since the program has been running successfully I have added certain new log file entries which naturally show up in the log file running now in debugger

    now trying to run program not in debugger but from IIS 10  localhost site

    1, create new directory ...inetpub/wwwroot/p4

    2, create new vs publish file system profile pointing to that directory

    3. publish

    4, in bin directory under p4 I have a myProgram.dll and a myProgram.pdb files with the current publish date and time

    5.  when running program from website, ie, localhost/p4/myProgram, I'm getting the same email issue that was solved and am not getting the latest log file messages ie, latest program changes written to logfile in debugger?? so evidently the publish is publishing some older version of the programI!! just which version I can't be sure because  I have made quite a few changes in pursing solving the email problem. But it is clear that the website is not running the same version as runs in the debugger!!!

    this is completely crazy to me. Its happened twice now with 2 different websites I've set up.

    this all should be so straight forward, especially when using the vs publish relying on that to copy all the necessary files and folders

    going crazy here

    Wednesday, October 11, 2017 7:04 AM
  • User1771544211 posted

    Hi bbxrider,

    Please try the following steps:

    1. Clean your project in VS 

    2. Delete the temporary aspnet folder for example: c:\WINDOWS\Microsoft.NET\Framework\<Version>\Temporary ASP.NET Files and find your app and delete it. If you cannot delete the files stop the worker process (w3wp.exe) or restart iis.

    3. Rebuild the project and RePublish it.

    Best Regards,

    Jean

    Thursday, October 12, 2017 2:41 AM