Intellisense error in razor view when create new module, after rename visual studio solution in Orchard CMS - orchardcms

I use orchard source code and want rename solution for fast switching between different projects. But when I changed solution name, and created new module via Orchard.CodeGeneration module, my solution not reloaded and I must include new module to solution explicitly (RMC to Modules folder -> Add -> Existing Project...). When I added to module .chtml files, intellisense not working correctly (dont see html helplers or Model property, etc.). If I try compile, all worked good, without errors.
If I rename solution back to "Orchard", and create module via codegen, intellisense working correctly for Razor view.
My workbench: visual studion community edition 2015 update 3.
Orchard version: 1.10.1
How i can fix this bug? Or is there another way to identify the project?

Related

Setting up a modular project in Android Studio

I'm coming from the Visual Studio world of solutions, where each solution can consist of multiple projects that can refer to each other.
What I want to do is create a modular Android project in Android Studio such that all my code doesn't live in one huge app project. However, it seems terribly difficult to do this, so much so that I am sure I am doing something wrong.
I created a blank project called MyProject. This creates a project with the name MyProject and a package com.sohum.myproject. There is a single app project contained within containing no source files.
I now want to add another module under the same namespace (e.g. com.sohum.myproject.library1). However, it seems when I try to add a new module via the menu, I can only do so into a com.sohum.library1 project. How do I get it to use the same package as the project?
My end goal is to have all my modules under the com.sohum.myproject package, referencing each other. For example:
com.sohum.myproject.application will be the entry point. It might depend on com.sohum.myproject.library1 and com.sohum.myproject.someotherlibrary. And I would like to see all of these modules when I open the MyProject file.
You can click File > New > New Module. Then choose Android Library and enter the details.
Reference: https://developer.android.com/studio/projects/android-library
Another way is to set up the project in a subpackage when creating it.
For example, create a project MyProject in a root directory. Call the application Application and rename the package to be com.sohum.myproject.app instead of just com.sohum.myproject. Now any new modules created will be added below the com.sohum.myproject package space.

How to import existing node.js module into Intellij IDEA?

I have an existing Node.js codebase, forked from GitHub. Now I want to import it to the Intellij IDEA 13 (ultimate version, which supports Node.js). When I simply try to import the project from the root folder of my existing code, IDEA doesn't add the 'lib' folder, where all the sources are. It should be simple, but I cannot figure it out. Any hints?
Well, I've figured out a workaround, but not sure if it's the best solution. One can just create a new project of type "Web", and point it to the directory containing the module's sources. Then IDEA understands the whole structure, and you can create run configurations with Node.js.
In order to get additional Node features, like Intellisense for standard Node APIs, you'll still want to configure the project to be a Node project:
Open the Preferences window
Click Languages & Frameworks → Node.js and NPM
In the section Coding Assistance you'll see if Node.js Core library is [not] enabled. If it is enabled, there's nothing more to do. If not click the Enable button
Leave For the whole project checked, and click Configure
The text should now change to Node.js Core library is enabled.
Another workaround:
If you have a version controlled Node app with no local changes, you could also create a new project of type "Node.js and NPM", point that to the directory. Then just use any standard settings.
After the project is created, you can just revert the files overwritten by IDEA (e.g. app.js and package.json), delete any new directories and files, and you will get the additional Node features in your project.
Intellij 15 Professional Edition:
Import a new project -> Select the base folder of the project -> choose import form existing source.
When Intellij is done it wont look correct so do the following:
1) Project Structure CMD + ;
2) Go to Modules
3) Add a new module and select Node/Npm (if you dont have it then add a new plugin)
4) Point the source of the project to the base folder and click apply.

Orchard CMS Custom Module Project File

I have an existing solution (multiple projects, one MVC web project) that I'm trying to wrap into an Orchard module.
All documentation says that the web csproj should be at the root under my module directory (eg Modules/MyModule/MyWeb.csproj).
However, I have an existing solution structure where the sln file sits at the top level and each csproj file (and project content) sits in its own directory (the standard solution structure when you build a multi-project app in Visual Studio).
Is there a way I can tell my Module.txt file that the Orchard Module csproj is under MyModule/MyWeb/MyWeb.csproj? I'd prefer to not restructure the whole solution.
Thank you.
Note: As a point of clarification, it is not ~/Modules/MyModule/MyWeb.csproj but ~/Modules/MyModule/MyModule.csproj. The Folder name of the Module must match the file name of the project (before .csproj). This is enforced by the Dynamic Extension Loader, which requires ~/Module/{ModuleId}/{ModuleId}.csproj. (A similar approach is required for themes.)
The only potential way to do this is to write a custom module that follows the above that contains a custom loader. Within your module, create your own implementation of IExtensionLoader, and register it with Autofac. However, I don't know if it would work; I've never tried.
You will probably have an easier time reorganizing your solution.

Which project file element specifies a WinRT class library project and not .NET?

I have a WPF class library that I want to port to be a WinRT class library. My plan is to copy the project, edit the project file so that it's a WinRT project instead of WPF, and see where I stand.
However, I cannot find which element in the project file makes it a WinRT project, and not .NET. Any ideas?
I've tried everything including diffing the project file with a WinRT class library project file, and slowly changing it over, but the WPF project never switches to WinRT in VS's eyes.
Sorry if this sounds nuts, I'm looking for the quickest way to find out how much work I need to do to port across.
Thanks
I'd take a different approach to that:
First I'd create a new Windows Store apps class library project.
Then I'd copy all the files from the existing WPF class library folder to the new Windows Store apps class library project folder (without overwriting any of existing files)
In the Solution Explorer window I'd enable Show All Files to see all the copied files and folders.
I'd multi select all the items in the treeview that belong to the project and click on Include In Project from the context menu.
At this point the only thing potentially still missing would be settings at the project level such as conditional compilation symbols and missing references which could easily be added by comparing both projects in Visual Studio or just trying to compile the new projects and seeing what goes wrong.

Orchard module doesn't work when built with VS2012

I've made a hello world module for orchard following this tutorial http://docs.orchardproject.net/Documentation/Building-a-hello-world-module
I've opened up the csproj in VS2012 and changed the projecttype guids to be MVC https://stackoverflow.com/a/12811015/828859
When I build the module in MVC orchard uses the published DLL.
When i attempt to go to the /helloworld route i get 404 resource cannot be found
When i save a file and let the dynamic compilation in orchard do it's thing it works fine.
I would like to be able to deploy with a DLL so does anyone have any ideas on the problem?
Ok, two things.
First - you won't be able to deploy your module as a single DLL. There are lots of things that do not get compiled into the DLL, eg. the Module.txt manifest. It has to be there under /Modules/<YourModuleName> (as well as module's .csproj file, .cshtml files and some more). Otherwise, Orchard won't be able to find your module.
So the source code for the module has to be there, although if you build it and the module's DLL is in /Modules/<YourModuleName>/bin folder, dynamic compilation won't kick in.
Second - module development should be done using full source code - not with the downloaded deployment package. Please read here how to get full source code.

Resources