Renaming ASP MVC Project Folder - asp.net-mvc

I recently needed to change the name of an intranet website FROM Spain, TO Monet. The conversion was complete and the website able to function (at least it seemed) until I removed the main project folder in order to rename it. Now I get the following error when I attempt to debug:
The request for 'Home' has found the following matching controllers:
Monet.Controllers.HomeController
SPAIN.Controllers.HomeController
I'm done a search of the entire solution for the old site name (SPAIN) and cannot find anything. Anyone have any ideas where I might want to looK?

You most likely still have the old compiled Assembly in the /bin dir; most likely named Spain.dll Since you changed the project name, the resulting assembly would have changed as well. If you didn't delete the old one, it's still there, and the app will still load it.

Related

Intellisense namespace discovery in Visual Studio not working after moving files to another project

I started with a single ASP.Net MVC project named Yogabandy2017 that had a folder called viewmodels. I stored all the viewmodels in it.
I moved all the files from that folder to another project called Yogabandy2017.Models where I stored all my models and I created a folder in it called Viewmodels where I put all the viewmodels, I also changed the namespacing in each of the viewmodels to match.
Then I did a large copy and 'replace all' in each view so that each view can now point to the correct folder like this
from this
to this, where I added the .Models to make the path correct
But intellisense still hasn't changed and picked up the correct path. I've tried to clean the solution, rebiuild it a couple of times. and still the path isn't connecting correctly. I still have the red underline and an exception being thrown when traversing the page saying it can't find the path.
Is there any way to get these paths to reset without going to each file and rewritting them manually? I have a few hundred and going through each one by one to make the change will take forever.
Any help would be appreciated...
Check your cases...
YogaBandy2017
vs.
Yogabandy2017

Why can't I view or edit Umbraco templates?

When I open the Umbraco (7.6.3) backoffice, I'm unable to view or make changes to templates. It seems like other functionality is unaffected, and I can create & edit specific pages. However, attempting to open the templates themselves just leads to a white screen. This problem exists across browsers:
Other screens render just fine:
What gives?
Checking the console when attempting to load gives an interesting error:
Error: Argument 'Umbraco.Editors.Templates.EditController' is not a function, got undefined...
Resolution:
The issue seemed to be caused by outdated files in the Umbraco folder. Copying most directories over from packages\UmbracoCms.7.6.3\UmbracoFiles\umbraco\ seems to have done the trick.
Looking at the changelog, it seems like the JS folder was the most influential in getting this fixed.
Are you sure that you're on 7.6.3? The UI appears to be pre-7.6 (I can tell because the colours haven't been updated).
If you have just upgraded, it's possible that your browser has cached the JS which is used - hard refresh your browser to see if the UI updates.
Umbraco also uses a dependency service to compile all of the used JS/CSS files together into one large one. This service will not be used if your website is in debug mode. Either:
Turn debug mode on in the Web.config
Delete any files in the \App_Data\ClientDependency\ folder as this is where the cached compiled files are kept (these will be regenerated)
My first thought would be file permissions.
Have you run the health check for permissions in the developer section? Need to make sure that your application pool user has write permissions on the Views folder.

Firefox Addon SDK Error - Module `project/tests/myjs` is not found at resource

As I progressed with my Firefox Addon development, I wanted to restructure into logical folder structures. And for the need, I thought of keeping some .js files under a directory called "tests", the moment I try to load by adding require('tests/myjs.js'), I am thrown with an error as below:
Message: Module myproject/tests/myjs is not found at resource://jid1-sdfe4541dfsafssdfewf45fa-at-jetpack/myproject/tests/myjs.js
Tried numerous attempts as I did not notice any difference than what was mentioned in official document - it always ended in failure and no much results online. It always worked when placed next to main.js on the same directory, but failed when in the sub directory.
Not sure if it is a bug or designed that way, but undocumented. The solution was to rename the folder. As a brute force way, just renamed the "tests" folder to something else, it worked. Worked with various folder names, but did not work with the folder name "tests".
If anyone knows why, would be better to share. Otherwise, I have my solution anyway.

How can I route my solution into different projects?

I'm looking for a solution to be able to store my websites in individual projects, while keeping one project as an entrypoint that can route into those projects.
The ideal setup would be something like the following:
- Main (entrypoint)
- Website1
- Website2
- Website3
I need this format to allow someone to access their website (ie. Website1) as a solution they can run and debug on their own, without having access to the entire application.
Basically, I want to be able to set up a new project, add the reference to the Main project, add an entry into my routes, and allow the new project to be built out and tested if it needs to be.
Is this possible?
I've looked at using areas and tried several plugins, but I can't seem to get this working properly. My biggest issue right now isn't routing into the project's controller, as I can get into that action perfectly, but once there, I can't reference any of the ASPX files properly. (I need to be able to reference them within the context of the project and the entire solution.)
If anyone could direct me towards other resources or questions I might have missed, I'd appreciate that as well. Thank you!
You should be able to doe this using a source control program of your choice. Put each website project in a separate folder and reference each website project file to a main master.sln file in a different folder called MasterSolution. Commit it all to source control. Then, for a user that opens Website one only, they just do open project, and go to the Website1 project folder and open the project file for Website1. Your MasterSolution is not opened but always gets the latest code as after the Website1 developer does a commit of his/her Website1 updates.

Absolute path for img and js excluding project folder name Visual Web Dev

I've this little but annoying issue in my project in Visual Web Developer 2010 Express. I'm developing a website with .aspx files located in a large folder structure i.e. www.domain.com/group1/type1/somefile.aspx, the root folder contains a "styles" (for css), "images" and "js" (for javascripts) folder. I've read a lot about base tag, absolute and relative path today. Finally I realized "absolute path" is the best choice for me.
The main problem is that when I preview (locally) my site in browser the absolute links for image, css, and js are not working, I'm using src="/js/gl.jquery.js" which I believe is correct and will work online.
The source code of the page for the javascript says http://localhost:61700/js/gl.jquery.js, when I switch to relative path script src="../../../js/gl.jquery.js" and preview the website, it works fine, and the source code for the javascript path says http://localhost:61700/ProjectName/js/gl.jquery.js (Notice Visual Studio added the ProjectName in the path) So I'm taking my guess that when the project goes online (on a main domain) it will work correctly, but right now I need to keep developing locally without this issue. Is there a way to fix this in Visual Web Developer? maybe some tag for the web.config file that I can remove when goes online, or some website property?
I know a quick solution will be develop with the relative path, and modify the code when goes online to absolute path, but I'm looking for some cleaner method, as aditional information I didn't choose base tag because I read cause troubles with anchors links (href=xx.html#question3) and I need to use them at some big files. And avoid the relative path because it's possible that the company ask me to move some files in the future and I don't wanna be updating relative paths.
Thanks a Lot!
Problem solved! This is the solution I found Thanks to ScottGu's Blog.
I quote the main thing:
when opened a web-site and run the project, VWD launch and run the built-in web-server using a virtual app path that equals the project’s root directory name. For example: if you have a project named “Foo”, it will launch and run in the built-in web-server as http://localhost:1234/Foo/Default.aspx.
One downside to this is that it makes it hard to fully qualify things like static CSS and image files within your site (for example: using root qualified paths like /images/myphoto.jpg or /css/mycss.css). Note that you can use the “~” app path trick for dynamic resources – but static resources still end up being a pain (js, css, images files.) (This was my issue)
Here is the guy entire post: Click Here
Here is the main solution:
1) Using the solution explorer within Visual Studio, select the web-site project node, (the one with the World icon)
2) There is a properties named "Virtual path" at the bottom. Change the "virtual path" setting it to / to run as a root web-site.
And that's it, setting up the / I can manage my files easily.

Resources