I have created .net core application some days ago. Now I don't remember exactly which template I have selected for the project. What is the way to know the project template selected for any project.
Problem here is when I generate "Controller with Edit/View using Entity Framework" the default behavior is it should generate controller specific folder in "Views" folder but it is not generating that folder.
If I click on any method (public ActionResult View()) and try to generate view it is generating view in the controller folder only. It should generate this in controller specific folder in "Views" folder.
You can see RouteConfig.cs file is inside App_Start folder.
But it does not have anything that will help to solve your problem.
you can follow my last comment.
The same problem happened with me. I just cut this folder with the generated file and pest it inside the views folder even though it worked. you can also try this
Related
In a UWP app using cppwinrt I want to use WebView to display contents of a book kept in the Assets folder. I read that it is necessary to reference an html asset this way for use as a Uri argument to the Navigate method in web view:
TheWebView.Navigate(Uri(L"ms-appx-web:///SampleBook/PageOne.html"));
This produces an empty view, while
TheWebView.Navigate(Uri(L"ms-appx:///SampleBook/PageOne.html"));
crashes. Msdn says that for files "that will be loaded into the web compartment" one must use ms-appx-web, and I've seen mention that this is a security issue. But does that mean the files are in a special location within the project - i.e. not merely in the Assets folder - or does it only mean that the path must begin with ms-appx-web independent of the file's location? "Web compartment" is not explained but seems to be not a location but rather a classification of the type of resource. At any rate, neither of the above approaches works, so I'm curious to know the recommended way to store and access a collection of html files in the package. In the assets folder? A special folder within assets? In Solution Explorer the html file is listed, "content" is True, and the file is Included In Project. Thanks.
My mistake: ms-appx-web does not point to the assets folder, but to its parent. The correct path for content of this type would be ms-appx-web///Assets/SampleBook/PageOne.html. The reference to material to be "loaded to the web compartment" apparently is just a way of saying: stuff to be loaded with WebViewer.
To create a New Project i am using WizardNewProjectCreationPage which creates a new project at root level.
Is it possible by any way to change that level.
For example there is already a root level folder in Project Explorer which contain some folders in it.Now i want when i right click on any of these folder and Add say New->Component.
On Component i have coded WizardNewProjectCreationPage,as i need the same functionality which ProjectCreationPage do .
But now i want this project should be added under the folder i right clicked and added component and so not on the root level.
No you can't do this. Eclipse projects can only be in the workspace root.
If you just want to create files and folders you can look at BasicNewFileResourceWizard, BasicNewFolderResourceWizard, WizardNewFileCreationPage and WizardNewFolderMainPage.
I'm starting to move away from having my classes in a folder called App_Code in my MVC4 projects, and moving all my classes into the folder called Models.
Now I've encountered a problem with my old code.
In my cshtml files I used to call my App_Code classes with a #using projectName.App_Code in the beginning of the file.
But that doesn't work now.
My question is therefore; How would I call a class in my Model folder from my cshtml files?
If you have moved your classes (and changed the namespace when you moved them) then you will need to change the #using namespace reference in the cshtml file from the old reference to the new reference.
To help with this, you could change your web project to compile the views to show any references that fail when you perform a build. To do this you will need to change the <MVCBuildViews> setting in the .csproj file to true as mentioned here by Phil Haack.
Additionally, as mentioned here in the answer by Javad_Amiry, you can update the list of namespaces that are used by your views by updating the <namespaces> setting in the the web.config file.
In VS2008, I am adding new classes to a web project.
When I right-click on App-Code -> Add -> New Item -> Class ...
The build action for the newly created item is set to content instead of compile. This seems like it would be a problem with the template. I've found several others through google who have run into this issue, but nobody seemed to have found a more permanent solution, other than "change it from content to compile after creation."
My question: Does anyone know of a fix for this, official or otherwise?
App_Code is a special folder meant for folder based projects.
This is just a hunch, but it might be that you have a project file based project, instead of a simple folder based one.
I am creating a number of WPF applications that all relate around one central WPF application and need to share the same styles and resources. In the first place I created a folder in my main project and added some XAML styles which all worked in displaying UI in the styles I wanted.
Later, I created another application but wanted to share the same styles so I moved the styles into a third project, added that project to the main application and added the reference to the styles project.
The problem is that the will not recognise my styles project. I prefixed the style with the project name and that did not work at all.
I have now got to the point where I can enter the entire relative path to the xaml files in the Path section of the ResourceDictionary and that works. However, If I move the project to another folder then that would fail. I suppose you may ask why I would do that and there are reasons, such as simply refactoring my project structure. Therefore, it would be easier to address the resources by reference rather than file.
I know the answer is inches away but I cannot find anything related to styles from another project.
I have had great feedback from this site so far and any help would be greatly appreciated.
OK, I have sussed it! Basically, you add your styles to a set of resource dictionaries in a separate project then you add the project to the solution and make a reference to it in your main project. I got that far but needed to reference the xaml resource files from my resources in my main project.
I tried using the full path name but while that worked, it was not a very good solution because if I move my project and re-link it, the file will because invalid.
The syntax I used that works is as follows:
<ResourceDictionary Source="/StyleResource;component/MSResources/TabControl.xaml" />
Where StyleResources is the name of my project that holds my shared styles, MSResources is the folder in the styles project that holds the xaml file and the file name at the end is obvious.
I have not yet read up about the “component” reference but it works so I will look at it later and update this post.