I have a examine controller (ExamineJsonIndexer.cs) that indexes json data. The controller is located in a class library project within the Umbraco solution. In order to run the controller code I need to have access to the Umbraco.Core.
Upon build the class library project returns a customClassLibrary.dll file which is then referenced in the Umbraco project. All seems to work fine locally but when publishing the customClassLibrary.dll file to the server the site breaks?
I'm guessing the customClassLibrary.dll file not only includes the code of the ExamineJsonIndexer.cs file but also the dependent Umbraco.Core. So when referencing the customClassLibrary.dll file within the Umbraco project there are two dll files with duplicate code.
umbracoSite.dll (has Umbraco.Core among other things)
customClassLibrary.dll (has Umbraco.Core)
If I would like to separate my custom classes with a class library project in order to generate a separate dll file for me to publish to the server how would I do this? The reason I would like to build a separate dll file for the custom classes is that I don't publish the site from VS. I'm basically using FTP to move files from VS to the server and Courier to move data.
I do this by creating a class library and added via nuget the Umbraco but only the Core.
Install-Package UmbracoCms.Core
or
Install-Package UmbracoCms.Core -Version x.xx.x
So I create everything separately. Normally the front-end project is only for Views (templates) and App plugins. The controllers and Application event handlers do everything separately.
When you reference the class library in the web project that you publish, when compiling the dll will be in the bin folder
access ApplicationEventHandler in class library
Hi,
I have a examine controller (ExamineJsonIndexer.cs) that indexes json data. The controller is located in a class library project within the Umbraco solution. In order to run the controller code I need to have access to the Umbraco.Core.
Upon build the class library project returns a customClassLibrary.dll file which is then referenced in the Umbraco project. All seems to work fine locally but when publishing the customClassLibrary.dll file to the server the site breaks?
I'm guessing the customClassLibrary.dll file not only includes the code of the ExamineJsonIndexer.cs file but also the dependent Umbraco.Core. So when referencing the customClassLibrary.dll file within the Umbraco project there are two dll files with duplicate code.
If I would like to separate my custom classes with a class library project in order to generate a separate dll file for me to publish to the server how would I do this? The reason I would like to build a separate dll file for the custom classes is that I don't publish the site from VS. I'm basically using FTP to move files from VS to the server and Courier to move data.
Best regards /David
Hi David,
I do this by creating a class library and added via nuget the Umbraco but only the Core.
or
So I create everything separately. Normally the front-end project is only for Views (templates) and App plugins. The controllers and Application event handlers do everything separately.
When you reference the class library in the web project that you publish, when compiling the dll will be in the bin folder
I just discovered that the class code was dirty and now its working :D.
As you said, I did install the Umbraco.Core via nuget to the class library.
Thanks
is working on a reply...