I can log in, but a page refresh logs me out - aws-lambda

I have one project, which I’ll call “Working”, because it works fine, and all login/etc. works fine.
I copied the “serverless.yml” file and changed everything appropriate to start a new project, which I’ll call “Puzzling”.
On the “Puzzling” project, I can log in just fine, but when I refresh the browser, I’m logged out again. So I cannot do things like (e.g.) change a user’s password.
I have all the Cognito configuration in a “config.json” file, with all the right settings.
In fact, if I copy just the “Puzzling” config.json file over to the “Working” project, then the “Working” project stops working properly! So I don’t think it’s my code.
I’ve compared the two “serverless.yml” files carefully… I don’t see anything different.
Any clues VERY MUCH appreciated… Thanks!

Fixed: Rebuilt the project by copying from "Working".
POSSIBLY:
One difference is that "Working" allows users to sign themselves up, and "Puzzling" did not.
Another thing is that when I went to delete the server code, it failed, saying that the database (or another resource, I forget exactly) was owned by another project. I deleted that project through the AWS Cloud-formation UI (which only partly worked...).
(And thanks #NewUser, but it's really a lot of code.)

Related

User Settings Not Working When Deployed By Setup Project (C# VS2013) *FIXED

I have made a few setup projects in my time, but this is a first for using User Settings. I may be using the wrong "words" when searching since I cannot be the only person with this issue.
The user settings I am talking about, are the settings you define in the Project Properties -> Settings. They work like a charm inside VS, but when I make the installer (using the free setup project extension, not the WiseInstaller LE that is included) and run the EXE, nothing takes.
I tried including the settings.settings file, and the App.Config file but that idea did not work.
What am I doing wrong? If I need to convert these to registry entries, then I need to do a lot of recoding. These are scoped to User, not Application.
Thanks,
Dave
I figured it out, it had nothing to do with the setup project, but rather my code flow. The settings form first tried to connect to the DB, since the connection information is entered on that form, it threw a cannot find error, so thinking that is what it should do, I hit continue. Well I was a bit wrong.
That error kind of made the form stop working since the information comes after the DB connection. I added a trap, and changed the code flow and all is good again.
Thanks
Dave

ClickOnce Error "different computed hash than specified in manifest" when transferring published files

I am in an interesting situation where I maintain the code for a program that is used and distributed primarily by our sister company. We are ready to distribute the program to all of the 3rd party users and since it is technically our sister companies program, we want to host it on their website. (in the interest of anonimity, I'll use 'program' everywhere instead of the actual application name, and 'www.SisterCompany.com' instead of their actual URL.)
So I get everything ready to go, setup the Publish setting to check for updates at program start, the minimum required version, and I set the Insallation Folder URL and Update Location to "http://www.SisterCompany.com/apps/program/", with the actual Publishing Folder Location as "C:\LocalProjects\Program\Publish\". Everything else is pretty standard.
After publish, I confirm that everything installs and works correctly when running directly from the publish location on my C: drive. So I put everything on our FTP server, and the guy at our sister company pulls it down and places everything in the '/apps/program/' directory on their webserver.
This is where it goes bad. When I try to install it from their site, I get the - File, Program.exe.config, has a different computed hash than specified in manifest. Error. I tested it a bit, and I even get that error trying to install from any network location on our network other than my local C: drive.
After doing the initial publish in visual studio, I have changed no files (which is the answer/reason I've found by doing some searching about this error).
What could be causing this? Is it because I set the Installation Folder URL to a location that it isn't initially published too?
Let me know if any additional info is needed.
Thanks.
After bashing my head against this all weekend, I have finally found the answer. After unsigning the project and removing the hash on the offending file (an xml file), I got the program to install, but it was giving me 'Windows Side by Side' Errors. I drilled down into the App Cache were the file was, and instead of a config .xml file, it was one of the HTML files from the website the clickonce installer was hosted on. Turns out that the web server didn't seem to like serving up an .XML (or .mdb it turns out) file.
This MSDN article ended up giving me the final solution:
I had to make sure that the 'Use ".deploy" file extension' was selected so that the web server wouldn't mangle files with extensions it didn't like.
I couldn't figure out why that one file's hash would be different. Turns out it wasn't even the same file at all.
It is possible that one of the FTP transfers is happening in text mode, rather than binary?
For me the problem was that .config transformations were done after generating manifest.
To anyone else who's still having trouble, five years later:
The first problem was configuring the MIME type, which on nginx (/etc/nginx/mime.types) should look like this:
application/x-ms-manifest application
See Click Once Server and Client Configuration.
The weirder problem to me was that I was using git to handle the push to the server, i.e.
git remote add live ssh://user#mybox/path/to/publish
git commit -am "committing...";git push live master
Works great for most things, but it was probably being registered as a "change," which prevented the app from installing locally. Once I started using scp instead:
scp -r * user#mybox/path/to/dir/
It worked without a hitch.
It is unfortunate that there is not a lot of helpful information out there about this.

I've been asked to deploy, but I cant make the magic happen

I've added a couple of lines to a file, let's say it builds to be foo.dll. It's part of more then one dll file, but it's the core dll. What I did was that I added a couple of lines so it should add some log data to the database. It should not affect any other files what so ever.
So i tried to deploy it. We don't have the magical one click deploy, we are just copying the right files to the right place.
So now, since i have a change in foo.dll, i thought for myself that i just could copy foo.dll and the server would be happy.
I was wrong. Browsing the website i now get "Generic Errors", dont know what that is. I've also tried to copy all the new dll files (4 i total) but that did not solve the problem either.
The error it gives are
Http Error 404.0 not found
Module: ISS Web Core
Notification: MapRequestHandler
Handler: Static File
Error Code: 0x80070002
replacing the new foo.dll with the old one solves the problem. and i've tried to restart the webserver. :-(
I asume you have "published" and not just "compiled" your Web?
You also need to take care off the "Solution Configurations": Debug and Release.
In a normal publish process you would change the configuration to release and publish your project into another folder.
After you have done that you just need to collect the desired files and upload them.
Keep in mind that you need the newest version of you web project. Maybe there are some changes online that your local project hasn'T. This would cause such problems.
We don't have the magical one click deploy
Why not? It's not magic, and it's pretty easy to set up. Get any continuous integration software (I would recommend BuildMaster since I am a developer for it and it's free now) and you'll never have this problem again.

MSTest stops debugging tests outside test project in 2010

I have no idea how this started so I'm guessing there's a setting somewhere that I've been unable to find. I have a test that calls a method but when I run debug, it simply will NOT step into that dll. At all. Period. Throws an exception just fine, but it's kind of worthless when I can't step into see what's actually going on.
When another team member picks it up, he's able to debug the exact method I was attempting to target. Yes, same breakpoints, yes, same code (I checked in, he got it, ran just fine)
What the hell?
update : checked the test project for stupid entires, deleted the debug/release folders for fun, I've went though and dumped the project completely and got it back out of tfs. I've nuked the appdata/local/ms/vs/10.0 folder and the /appdata/roaming/ms/vs/10.0 folder. Deleted the local test results.
You probably need to investigate your project references. Is the DLL possibly GAC'd? Take a close look at the *.csproj file.
The fact that it can be debugged no problem on someone else's machine indicates to me that you're having an environment issue. Some sort of multiple library reference issue.
Another possibility: Visual Studio (and all its embedded tools) can have many strange caching behaviors. You might want to clear out extraneous MSTest-related temporary cache files/dirs.
Ok, got it. You can't do one of those things and it works. I had to do them all prior to opening up vstudio again. It'll blow your settings away just as a heads up.
Kill the AppData/Local/Microsoft/visualstudio/10.0 folder
Kill the AppData/Roaming/Microsoft/visualstudio/10.0 folder
Kill your entire project ... all of it.
Get latest (force)
And it works again.

Publish Web Site all of a sudden no longer working

Out of nowhere the "Publish Web Site" option in Visual Studio isn't doing anything for a particular project. It still compiles the site (no errors), but it never copies the output to the destination directory. I've tried changing the destination to a number of locations, and it creates the new folder, but never copies the output. I tried other projects and they seem to work fine. What would stop one project from copying the output?
Update: This is a web site project, if that makes any difference.
It appears the problem was with the "Allow this precompiled site to be updateable" option. This was turned off at some point and was causing the problem. Turning it back on caused the files to be copied again. Why should this make a difference? Is there another setting somewhere that needs to work in conjunction with this setting?

Resources