Friday, August 3, 2018

c# - "CS0103: The name 'model' does not exist in the current context" error on SERVER only

Overview



I'm trying to patch an existing MVC 4 web app to MVC 5 and from Oracle DataAccess 11g to 12c. It runs fine locally in Visual Studio with no errors, with full functionality. However, when I move it to the dev server, I get the following error:




Compiler Error Message: CS0103: The name 'model' does not exist in the current context
I looked at the following posts, and tried the fixes there without any luck:





I think they don't really apply here because the errors in those posts are occurring in VS, which is working fine for me. Unless I'm looking in the wrong place, my issue appears to be with the settings in IIS on the dev server. That said, if you want me to post the web.config file(s) I can do so.



Application




As I said above, I tried all the fixes in the two links I provided, to no avail. My Web.config files both seem to be okay; at the very least I'm able to run locally without issues.



I'm running the latest version of MVC 5, Razor, etc:
enter image description here



I also tried setting Copy Local to True for all DLLs, which was kind of a blind shot and didn't do anything.



When publishing the site I target "any CPU" and I do not precompile. I tried fiddling with both settings, and it doesn't seem to make a difference.



Server Stuff




My devops are unwilling or unable to help with this issue. When I go to them they simply say "what do you want me to do, it's the dev server." Server stuff isn't really my strong suit, so I'm in "poke and pray" mode.



The server is running Windows Server 2008 R2 with all the latest patches.
When I look at the "installed programs" section of the Control Panel it shows .NET Framework 4.7.1.



When I look at the basic settings for the IIS app pool associated with the application it shows the .NET Framework version as .NET Framework v4.0.30319 with the Managed Pipeline Mode set to integrated. Is there a reason that it's different than 4.7.1? Again, IIS is not my field of expertise.



When I look at the Advanced Settings for the app pool it shows the framework version as 4.0, and "enable 32-bit" as false. Let me know if there are any other settings you'd like to know.




Both 32- and 64-bit versions of Oracle 12c are installed on the server. I verified this with the DBA.



This is incredibly frustrating, because it appears to be fine locally, and I'm not sure where to look to see what's different on the server. I'm getting zero help from the server guys in my department. Any help from here would be greatly appreciated.



Update
Thanks for the comments, they contained excellent information. I had already tried making sure that the web.config files were available, and they were. What I wound up doing to fix the issue was to remove and recreate the "site" in IIS. I have no idea why that fixed it. As I said in the initial comment, I'm not a server guy

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...