Skip to main content

The view or its master was not found or no view engine supports the searched locations!!!

On an MVC application, if you are getting error "
The view or its master was not found or no view engine supports the searched locations" and you see that this view (.cshtml file)is already present under the correct folder structure and every thing is correct and you have also tried a lot of posts on SO on how to fix that and that hasn't helped,  just check the build action for this file and make sure that it is set to "content". I have seen the build action set to None (by mistake)and after you deploy/publish  the application, that view would be missing  and you get this error .

Comments

Popular posts from this blog

Know where to patch!!!

Have you tried to patch a function call in your unit test and wondering why the hell patching is not working, value I'm returning from the patched function is not the value being used in the function call. Well, may be you are not patching at the right place. I saw this problem at work. I'll try to explain with a simple example. you have a module module_a which has a function greet. There is another module module_b which uses this function from module_a in another function - sayHi . When we write test case for module_b's sayHi, we want to patch function call to module_a's greet method. module_a.py def greet (): """ returns sum of two numbers""" return 'hello world' module_b.py from module_a import greet class myClass (): def sayHi ( self ): return greet() if __name__ == '__main__' : res = myClass().sayHi() print (res) test_mod_b.py import un...

Optional Parameters in C#

C# 4.0 has a nice feature of creating methods with optional parameters which allows caller to pass only required parameters and not all. This is particular helpful in methods which needs a lot of parameters. Method with optional parameters : Out put :15 Here caller is only passing one parameter i.e. 5 and output is 15 because default value for parameter b is used which is 3. but, care should be taken when you create methods with optional parameters in a library which is used by third party application (where you have less control) because by just changing the default value in the library , if this new library is deployed (with every thing as it is),  client apps will NOT see the change. Client application also needs to be re-compiled with the updated library to see the changes because of the new default value.  in the above example , if OptionalParam.exe uses   updated library.dll (without recompiling the complete solution ) where default value of...