I am working on custom multi solution project structure having
1. 4 class library projects
2. One MVC 4 Web application.
I have built multi solution structure into VSIX package.Till here everything is fine.
Upon VSIX installation,I can see my multi solution project type in Visual studio 2012 projects.
When I try to create on out of it, it will display a following error while creating for every images present in "\Content\themes\base\images" in MVC 4 application
"The file ui-bg_flat_75_ffffff_40x100.png could not be found within the project templates.Continuing to run, but resulting project may not be build properly"
Although I have all the images as a apart of WEb Project templates.
Any suggestions
Verify that the images within the project template have Build Action set to Content and Include in VSIX set to True. Also, verify in your vstemplate file that the image is included as a ProjectItem and within the proper folder.
Or, if you have JQuery UI included as a Nuget package you can just install the package as a part of your template. Then, you don't even need to include the images with your vsix. http://docs.nuget.org/docs/reference/packages-in-visual-studio-templates
Related
I installed Umbraco 8.4 as per the instructions found at https://our.umbraco.com/documentation/Getting-Started/Setup/Install/install-umbraco-with-nuget
Once done within Visual Studio 2017 i tried to created a new Controller and the folder (Controllers) was missing.
I'm not sure if i've missed something but i didnt want to create the folder manually in case it introduces new problems later down the line.
I thought to recreate the project but instead of selecting Empty as the project to use MVC but after reading through a few threads it seems the correct way is to select an empty project.
Under the bin directory i do see System.Web.Mvc.dll
Am i missing something?
You should definitely not use the MVC project template when creating a new project - that will add all sorts of dependencies that will likely conflict with what comes with the Umbraco NuGet package.
Go with the "Empty" template and then add in the NuGet and it will give you the dependencies you need for Umbraco to run. If you need to add in other stuff from MVC afterwards, you can add these in a version that aligns with what the Umbraco package has added.
In regards to the Controllers folder - it really doesn't matter where this folder lives or what it is called. Controllers are registered by other means. You are totally fine to create this folder manually and call it whatever you prefer.
I think most people actually prefer to keep Controllers in a completely separate project in the VS solution. Then reference that project by your main project to ensure the compiled DLL is included in your web project - and thereby your controllers can be used by the Umbraco website itself. By doing this, you get a clean separation of your .cs source files so you won't accidentally be deploying those when you deploy your site. To do this you would of course require to add UmbracoCms.Core NuGet package to your other project in order to use Umbraco functionality.
Keep in mind if you are adding plain MVC controllers (not inheriting from the Umbraco base controllers - and therefore not getting automatically registered) you will need to manually register these controllers in the route table in order to access them.
This is no different from what you would do in a normal ASP.NET MVC project, but since this isn't added by default in an Umbraco project - you need to do it yourself.
See this answer for instructions on how to do it: https://stackoverflow.com/a/56972929/336105
Using Visual Studio 2015 I can add a Resource File (Resource.resx) to an MVC 6 Project. However the modifier of the resource defaults to: Internal.
If I right click on the resource and select properties I cannot see any of the Advanced properties that I used to be able to see i.e. Browse to URL, Build Action, Copy to Output Directory, Custom Tool and Custom Tool Namespace. The only two properties I can see are the Misc ones i.e. File Name and Full Path.
If I open the resource by double clicking on it, the Access Modifier in Visual Studio is disabled.
What am I missing?
Localization works a little differently in MVC6.
An example can be seen here: https://github.com/aspnet/Mvc/tree/dev/samples/LocalizationSample.Web
One important note is that you have to run the application using: dnx web as there is a bug when running the application from visual studio. See this issue for more information.
I have access to a working ASP.NET MVC 4 website through FTP but do not have the Visual Studio project file. Using these files can I create a Visual Studio project file?
If you have access to all the class files, views etc but are just missing the solution/project file then technically you can wrap them up in an empty project but it would still be a different project.
If you only have access to the published output (the views and JavaScript) then in short the answer is no, not without trying to reverse engineer the dll which I have heard is possible but have never tried myself.
I want to run my ASP.net MVC project without using a particular shared editor template that has errors
eg.
~\Views\Shared\EditorTemplates\String.cshtml
But even when I right click and exclude it from the project, it is used when the project is run and it errors out. What should I do to tell Visual Studio to ignore this template?
I'm using Visual Studio 2012 Professional.
If you want to keep the file, but not have ASP.Net MVC use it, rename the file. Call it -String.cshtml.
DisplayTemplates and EditorTemplates are looked up in their respective directories, matching filenames to the type they are used on. When you exclude them from the project they are physically still present and found, therefore still used.
We are in the middle of development for a core ASP.NET MVC web project and a customer plugin in the form of an MvcContrib plugin web project -- a web project injected into the core web as an area. The plugin is a soft reference in the core project, so it can be developed completely separately and dropped in.
I am trying to generate a way to debug/code the plugin, so that the multiple custom plugins can be developed independent of the core web.
The developers should only have to worry about coding and testing the plugin code. Also, I don't want them to change the core code in this custom plugin project -- that should be done in the core anyway.
I created the core web as a NuGet package and included all the necessary files so I could include it in a web.
My thinking was that I could create an empty web, install my core web, and the developers could have an F5-driven debugging environment.
I tested by creating a blank Mvc project, installed my core package and included one of my plugins. I changed the namespace of this empty web app to the namespace of the core web, thinking that Visual Studio debugging would properly attach and my core assembly.
Simple VS debugging in the empty app does not work -- I receive an HTTP Exception, most likely due to my routes not being registered. I also see that my log4net is not creating its logs folder, so I know the assembly's app start is not being called.
So I see that VS is not attaching to and calling my core assembly.
Can I use this empty web as a host project for my nuget installed web and debug? If so, what configuration am I missing?
If not, how can I include the core web in each customer plugin project in such a way that I can drop my DLL into the bin and debug it?
Using:
Visual Studio 2010
ASP.NET MVC2
The way we are doing things that works pretty well is to use a combination of Web Activator and Razor Generator (available as a Visual Studio extension). In order to access the views within the core web application, the consuming client application needs to know about them, either because they are all included as file references inside the Nuget package (messy) or because they are compiled into the core web dll. You can do that using Razor Generator. Once installed via Nuget you would need to change the Custom Tool property for each .cshtml file to RazorGenerator, which will create a .generated.cs file for each view. This will allow your sample client to use the layout and views from the core web application.
David Ebbo has some useful blog posts on Razor Generator
Couple that with Web Activator to create a PostActivationStartMethod that runs your initialisation code (such as initialising Log4Net) and you should be good to go. We've had this running in 2 scenarios - consuming the framework package via Nuget and adding a project reference directly. Debugging was not working for the Nuget package consuming route but we don't include the pdb files in the Nuget package. We can debug when adding a project reference directly though.