I downloaded SP1 for Visual Studio today (497 mb - ouch!). AJAX insisted on it. I can build and run a local page using AJAX. But when I publish and copy to my web host provider I get this error:
Parser Error Message:Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 27: <compilation debug="false">Line 28: <assemblies>Line 29: <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>Line 30: <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>Line 31: <add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
'System.Web.Extensions' is a dll in the AJAX bin directory (along with AJAXExtensionsToolbox.dll - actually it's not in the exact same directory but I digress). I looked around on the web and it seems Visual Studio adds that <add assembly statement to the web config on its own. Same with the System.Web.Extensions.Design. I commented those two statements out and rebuilt and VS added two new ones - so that's true.
One site something about turning the "Get Specific Version" option for the toolkit to false. It also said something about VS grabbing everything in the reference hierarchy when it doesn't need to. I read that it could be the IIS implementation's fault but if it's in the bin at compile time then it shouldn't matter.
I've tried to add it as a reference in the project but after I navigate to it and select it the dialogue box just disappears and it doesn't get added.I've tried dropping it into the bin directory of the published site but that failed. I tried editing the "<add assembly" statement out of the published config file but that didn't work either.
Anyone have any ideas?
Thanks - Foolong
All you need to do, is copy the System.Web.Extensions.dll and system.web.extensions.design.dll to your websites bin directory on the web server.
On your local machine these live in the GAC but once they are on the server, unless Ajax has been installed directly on the server, they dont exist in the GAC and need to live in the bin.
Hi Bryan,
Thanks for your response!
I tried that both by dropping them in after publishing to a dir on my box and also dropping them into the project folder and then publishing. Still get the same error. I'm opening the folder on my web host provider's server up and the dll's are there. I even tried stripping off the 'version', 'culture', 'publickeytoken' params from the <add assembly tag.
Nothing seems to work.
This is too bad too because I just graduated w/ a BS in Computer Science and NOBODY hires unless you have at least three years of experience. I was hoping to use this stuff to to make my site (ergo my resume) look better.
Should have gone after an engineering degree :-(
Sorry you're having trouble with this. There is a point of interest that may affect your issue. You must be able to run your application in FULL TRUST on the server, for it to be able to use the ajax assemblies from the /bin folder. The other option is to have the MSI installer run on the server, which will put these into the GAC and should fix most of the problems.
Who is your host, and what is your servers availability to be modified / administered?
One other thing you may try, is changing all the lower case letters in your Public Key Token portion to Capital letters. It's fixed things in some cases.
I would venture to say that 5 will get you 10 that my web host provider has something to do with this! I just got off the phone w/ them asking
A) if they are making these files available globally - said yes but when I asked if the System.Web.Extension.dll and System.Web.Extension.Design.dll files were in the GAC - he didn't know for sure; and
B) when I told them I was including them in the bin directory and needed full trust he said they can't give that to custom dll's.
Oh well - I guess you get what you pay for.
I really apprreciate your help Bryan and will definitely post back when I get this figured out.
Thank again
Pat
The key is going to get them to install them in the GAC then if they wont give full trust to custom dll's. Of course, depending on how tight they have their security, you MAY be able to override your applicaiton or machine settings, by explicitly setting it in your web.config. Most of the time this will try to override a machine key though, and it will throw you an exception about it not being allowed, but it's always worth a shot.
Try putting this in your web.config under the system.web node
<system.web>
<securityPolicy>
<trustLevel name="Full" policyFile="internal" />
</securityPolicy>
<trust level="Full" originUrl="" />
</system.web>
Like I said, this doesnt usually work, but it's easy enough to give a shot. If it doesnt work you'll get a message about the Machine.config not allowing override.
No comments:
Post a Comment