DavidAnson/PassWeb

[HttpException (0x80004005): Could not load type 'RemoteStorage'.]

yrest opened this issue · 6 comments

yrest commented

Hi David, would you be able to help please? Getting it on localhost and online (including Azure). It is coming from server error 500.

Could you please confirm you have un-commented BLOCK_NEW as described in the README?

https://github.com/DavidAnson/PassWeb/blob/master/README.md#configuration

yrest commented

Yes, on localhost the top of the file looks like following
// Restore to allow callers to list files (not required for PassWeb)
#define ALLOW_LIST
// Remove to prevent the creation of backup files for each change
#define BACKUP_FILE
// Remove to allow the creation of new files
//#define BLOCK_NEW
// Restore to enable simple support for Cross-Origin Resource Sharing
//#define SIMPLE_CORS
// Remove to allow requests to be handled as fast as possible
#define THROTTLE_REQUESTS
// Restore to allow bypass of BLOCK_NEW (necessary when testing)
#define TEST_ALLOW_BYPASS_BLOCK_NEW
// Restore to allow list to include backup files (necessary when testing)
#define TEST_ALLOW_LIST_INCLUDE_BACKUPS
// Restore to use a unique storage directory (preferred when testing)
#define TEST_CREATE_UNIQUE_DIRECTORY

On Azure, I initially did not comment out the BLOCK_NEW, but just did it there now, re-synced it, restarted the app and result is still the same.

yrest commented

Maybe I misread something. In my localhost i have added passweb folder and copied all content in there.
When launching the site, all looks good apart from Chrome complaining "Unrecognized Content-Security-Policy directive 'referrer'."
Then I'm typing in a username, which could be anything and clicking Unlock. Getting
render.js:5 GET http://localhost/passweb/RemoteStorage?name=9a2c7e3cbcb396dc47b53da026b44557e45a1048113f503c42950a6cddd987afa08462c342adef7edae01fc2cf3eca88048145aa8780228d886e334dd9ecd643&_=1506980009617 500 (Internal Server Error)
ajax @ render.js:5
readFromRemoteStorage @ default.js:617
LoginForm.self.submit @ default.js:79
(anonymous) @ render.js:3
r @ react.min.js:14
i @ react.min.js:12
s @ react.min.js:12
p @ react.min.js:12
f @ react.min.js:12
r @ react.min.js:16
processEventQueue @ react.min.js:12
r @ react.min.js:14
handleTopLevel @ react.min.js:14
a @ react.min.js:14
perform @ react.min.js:16
batchedUpdates @ react.min.js:14
a @ react.min.js:15
dispatchEvent @ react.min.js:14
default.js:795 Error reading from cloud; no local data available. (Network problem or bad user name/password?)
default.js:795 File name: 9a2c7e3cbcb396dc47b53da026b44557e45a1048113f503c42950a6cddd987afa08462c342adef7edae01fc2cf3eca88048145aa8780228d886e334dd9ecd643

When digging into the error, the following comes up.

Could not load type 'RemoteStorage'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Could not load type 'RemoteStorage'.
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[HttpException (0x80004005): Could not load type 'RemoteStorage'.]
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +426
System.Web.Configuration.HandlerFactoryCache.GetTypeWithAssert(String type) +48
System.Web.Configuration.HandlerFactoryCache.GetHandlerType(String type) +17
System.Web.Configuration.HandlerFactoryCache..ctor(String type) +25
System.Web.HttpApplication.GetFactory(String type) +104
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +261
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2556.0

Let's start with IIS Express. I've verified the following steps on two different machines:

C:\T>git clone https://github.com/DavidAnson/PassWeb.git
Cloning into 'PassWeb'...

C:\T>cd PassWeb

C:\T\PassWeb>notepad App_Code\RemoteStorage.cs

Comment-out the following #define and save the file:
#define BLOCK_NEW

C:\T\PassWeb>"C:\Program Files\IIS Express\iisexpress.exe" /path:C:\T\PassWeb
Starting IIS Express ...
Successfully registered URL "http://localhost:8080/" for site "Development Web Site" application "/"

Open web browser and navigate to http://localhost:8080/

Name: name

Click Unlock

Expected (because there's no data): "Error reading from cloud; no local data available. (Network problem or bad user name/password?)"

New Entry

Title: title
Password: password

Click save icon

[Saves]

F5 to refresh

Click Unlock

Shows entry added above

Reading your description again, it sounds like maybe you're not putting App_Code at the root of the site. That's where it needs to be for ASP.NET to see it and load code from it.

yrest commented

Thanks David, that makes sense! I was not making PassWeb as entire site, instead of root putting it into a subfolder.