Could not load file or assembly 'Microsoft.Web.Preview'

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
10/14/2008 1:05:21 PM
Gravatar
Total Posts 26

Could not load file or assembly 'Microsoft.Web.Preview'

My installation on a Plesk host went quite well, but when I sign in as admin, and try to configure the site (gear icon), I get the exception:

Could not load file or assembly 'Microsoft.Web.Preview, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

This file is present in the bin folder, so I assume it's a version problem.  Any suggestions?

10/14/2008 1:08:25 PM
Gravatar
Total Posts 18439

Re: Could not load file or assembly 'Microsoft.Web.Preview'

It might be a medium trust issue. In medium trust it might be required to only run that file from the GAC (Global Assembly Cache) on the server. I would try deleting the one from the bin folder and hope it is installed in the GAC.

Hope it helps,

Joe

10/14/2008 1:20:06 PM
Gravatar
Total Posts 26

Re: Could not load file or assembly 'Microsoft.Web.Preview'

After deleting the dll, I know get the following:

[code=SERVER_RESPONSE_RESET] The server response could not be read because of an error. Contact your system administrator.

I might have deleted something else by accident, so check the whole bin folder.

I notice the version of the installed dll is 1.0.61231.0.  Could this mean anything?

 

BTW, I really owe you a few beers already.

10/14/2008 1:30:57 PM
Gravatar
Total Posts 18439

Re: Could not load file or assembly 'Microsoft.Web.Preview'

You could try putting the dll back and see if setting the version in Web.config to match it fixes it. Its declared in the assemblies section of Web.config. You could also try just commenting that out. As far as I know the only thing that uses that preview dll is the MyPage feature. The preview dll allows the webpart drag and drop to work in Firefox and Safari.

It looks like I may have updated the dll but not the declaration in Web.config

Hope it helps,

Joe

10/14/2008 1:37:40 PM
Gravatar
Total Posts 18439

Re: Could not load file or assembly 'Microsoft.Web.Preview'

No, I just tested it the version in Web.config was correct despite what the file version says.

10/14/2008 1:43:12 PM
Gravatar
Total Posts 26

Re: Could not load file or assembly 'Microsoft.Web.Preview'

Well, I changed the version in config, and now I get a whole new error:

Could not load file or assembly 'mojoPortal.Web'

This seems to be related to the <httpModules> section:

<add name="GCheckoutBasicAuthenticationModule" type="mojoPortal.Web.GCheckoutBasicAuthenticationModule, mojoPortal.Web" />

 

 

10/14/2008 1:52:30 PM
Gravatar
Total Posts 18439

Re: Could not load file or assembly 'Microsoft.Web.Preview'

Restore the previous version in Web.config. The advice to chage it was wrong.

10/14/2008 2:06:40 PM
Gravatar
Total Posts 18439

Re: Could not load file or assembly 'Microsoft.Web.Preview'

Next thing I would try is just commenting out that reference to the preview dll from web.config

 

 

 

 

 

10/14/2008 2:17:52 PM
Gravatar
Total Posts 26

Re: Could not load file or assembly 'Microsoft.Web.Preview'

OK, now I'm really stuffed.  I copied a web.config with a broken connection string, so mojo ran some configuration scripts when I fixed the connection string.  Now I can't sign in with my admin details, nor retrieve password, nor sign in with the defaults.  I'm going to try and recreate the database and start fresh.

10/14/2008 2:20:14 PM
Gravatar
Total Posts 18439

Re: Could not load file or assembly 'Microsoft.Web.Preview'

I'm in the process of uploading new files for the new 2.2.7.6 release, so if you are starting over you might as well get the new version.

Best,

Joe

10/14/2008 3:14:17 PM
Gravatar
Total Posts 26

Re: Could not load file or assembly 'Microsoft.Web.Preview'

I'm at least running again after creating a new database.  My upload speed to the host is dismal, so I have to upload a zip and ask the admin to unzip it there.  He's not here now.

Some detail:

If I use the 'Edit' link I can edit my home page.  I used to get an error after clicking Update, but the text did eventually render as updated.  I use the Pencil icon at the top right, in the title banner, I get the "Could not load file or assembly 'mojoPortal.Web' or one of its dependencies." errors.  If I click any of the four top right icons I get this error, no longer the original error.  If I click the gears icon to edit the settings for the content, next to the feature title, I get the same error.

10/14/2008 3:20:49 PM
Gravatar
Total Posts 18439

Re: Could not load file or assembly 'Microsoft.Web.Preview'

What is the structure of your url? Is it a root site or in a subfolder? If a sub folder then that folder must be marked as an application in IIS.

10/14/2008 3:22:18 PM
Gravatar
Total Posts 18439

Re: Could not load file or assembly 'Microsoft.Web.Preview'

I would look in the log under Admini Menu > System log. I would clear it first since it probably has a lot of errors from during the install. So clear it, then do whatver causes the error then look in the log for more detail.

10/14/2008 3:34:15 PM
Gravatar
Total Posts 26

Re: Could not load file or assembly 'Microsoft.Web.Preview'

I'll have to wait until I can talk to my host, but thanks for all your help.

10/16/2008 12:04:18 PM
Gravatar
Total Posts 26

Re: Could not load file or assembly 'Microsoft.Web.Preview'

Solved this one.  Your beers will be bought as soon as I can borrow a credit card.

The problem was that I had previously had a site called Admin under my root, and although I had totally overwritten it with the mojo admin folder, I had neglected to remove it as a virtual folder.  Every time a mojo admin function navigated there, it was looking for it's own bin folder.  Removed the virtual folder and all is well.

4/23/2010 12:03:10 PM
Gravatar
Total Posts 35

Re: Could not load file or assembly 'Microsoft.Web.Preview'

I know this is old, but I've run into this several times, so I thought I'd add my 2 cents.

 

I just copied the Microsoft.Web.Preview.dll from the _libs folder to the \bin of the Web folder.  I think this should get copied during one of the Post-Build events, but for some reason it does not.

5/6/2010 8:12:09 PM
Gravatar
Total Posts 3

Re: Could not load file or assembly 'Microsoft.Web.Preview'

 

Solved this one. Your beers will be bought as soon as I can borrow a credit card.

The problem was that I had previously had a site called Admin under my root, and although I had totally overwritten it with the mojo admin folder, I had neglected to remove it as a virtual folder. Every time a mojo admin function navigated there, it was looking for it's own bin folder. Removed the virtual folder and all is well.

THANK YOU SO MUCH!!! This had been driving me batsh*t crazy!!!  Thank you more than you'll know even thought this is old!

9/21/2010 7:56:27 AM
Gravatar
Total Posts 130

Re: Could not load file or assembly 'Microsoft.Web.Preview'

Hi Joe,

I just grabbed your latest source code (2.3.5.3) to upgrade my sites.  When I attempted to Deploy (to my IIS 7 localhost) I got the same exception the other folks did above, except that I hadn't done anything with the Admin directory so it didn't seem like a fix for me.  I tried removing the dll which didn't solve the issue, and ended up copying the dll from my older installation ( 2.3.5.1) into the new install bin directory and it worked.  I just wanted to let you know this has happened and see if you have any idea what the issue might be or if you think it could be problematic that I've taken the other dll file.

Best wishes,

Beth

9/21/2010 8:29:05 AM
Gravatar
Total Posts 18439

Re: Could not load file or assembly 'Microsoft.Web.Preview'

The mojoPortal.Web project has a reference to the dll form the _libs folder and when you build it should pull the dependency from the _libs folder into the /bin, but every now and then there can be environment issues where it doesn't happen due to permissions or something and then you can fix it by manually copying the file from _libs folder if needed.

When I pull changes and apply updates and rebuild it works fine for me, but I have seen this kind of thing for various dlls once or twice in the past. I remember at one time this was happening for me with the log4net.dll way back when.

That file (Microsoft.Web.Preview.dll) has been the same version for a very long time so any copy from any recent version should be identical.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.