c# - How should a controller be excluded on publish? -


I have a UNITST controller running a Jasmine test against the JavaScript code, which is a .NET MVC project. However, I do not want to be available when publishing the site.

I am thinking about some ways to do this, but I'm not sure what will be the best

  • Use those authorization features Which are being started to refuse to access it
  • Remove the controller from the collection of actually available paths

I keep things simple Iman is using the compiler instructions for this ( #IF DEBUG ) Of treachery, I think that the controller would be better options to overcome, but I'm not sure that he will place. Probably the Global C file?

I appreciate any suggestions if access to the controller is the best solution, so it is fine, and something that I can easily apply on my own. I think that should be a better way.

You can simply ignore the route conditionally:

  #if! DEBUG routes.IgnoreRoute ("UnitTest / {* pathInfo}") #endif  

Although it is not very different from removing the controller conditionally as you suggested.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -