1

I have a super basic form that shoots out an email. The code is contained within a virtual directory like http://url/emailer/emailer.aspx on a new server and is working fine.

We are in the process of migrating a few additional sites over to this new server. To test, I'm accessing the files via the ip address so I can see the site on the new server like http://ip/url/emailer/emailer.aspx.

For some reason, whenever I access the aspx page via the IP URL, I receive the "could not load the assembly...make sure that it is compiled before accessing the page" error. However, I've confirmed when pulled into the live site, it works fine.

Why does referencing the IP URL cause this exception?

3 Answers 3

1

Is it setup correctly in IIS? If it's not set as an application in the same way as the original server then it will be looking for the bin directory in a different location. For example, if you have /myapp as a directory, but not an application it will look in /bin, but if you change it to an application it will look for it in /myapp/bin.

The only other time I've seen this is when the same app pool is specified for 2 different apps, each set to run a different version of the framework. It doesn't sound like this is your problem, but it might be worth checking the app pool identities in case there's something else that's listening on the ip that might be using a different framework version.

8
  • Yes, everything is setup properly in regards to IIS. In fact, I can take the live URL on the new server and replace w/ the IP URL and it won't work. Commented Mar 3, 2009 at 15:54
  • And the ip is pointing to exactly the same IIS site? The way you describe one as url and the other as ip/url sounds.. odd? Commented Mar 3, 2009 at 16:17
  • Yeah, I should have probably been more clear. I have the folder structure setup like C:\Inetpub\wwwroot\myurl1.com and C:\Inetpub\wwwroot\myurl2.com. So when I go to myrurl1.com it points to C:\Inetpub\wwwroot\myurl1.com. Same with ip/myrurl1.com. Commented Mar 3, 2009 at 16:36
  • That implies that they are two separate IIS sites then? One being your "default" site that hits wwwroot, the other a host headered version? If so it sounds like an app pool issue as per my edit above, or the framework version is set wrong on the default site. Commented Mar 3, 2009 at 16:45
  • Yes, I guess you are right. I've confirmed the Default Web Site is set to the 2.0 framework. I've also run aspnet_regiis.exe -i in the 2.0 framework to reset everything. However, everything is set to the same app pool. Is that the issue? Commented Mar 3, 2009 at 16:52
0

This could be an IIS issue. Sometimes IIS is setup so that the IP address itself is pointing to another site since you have multiple web sites/applications all on the same server and some are picky about what the URL is for proper resolution.

Can you check the IIS settings for the application and see if the IP address is mapped to your site?

1
  • Yes, I've confirmed the IP is mapped to my site. To confirm, I created a new html page on the live site and was able to see in both the url/email/a.htm and ip/url/email/a.htm URLs. It's something related to .Net somehow. Commented Mar 3, 2009 at 15:59
0

I have run into this problem sometimes when the server I am on is running low on disk space. The site attempts to load the referenced DLL, doesn't have enough free space to do so, and then throws this error.

Just something to check. This happened to me with a partitioned drive where the C:\ drive was basically filled up by Windows Updates and even though the sites were on the D:\ drive, there wasn't enough space left on C:\ for IIS to load the assemblies.

1
  • That's a good thought however we have 136 GB left so space is not an issue. Commented Mar 3, 2009 at 16:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.