Umbraco and YAF - c#

I am trying to use YAF with Umbraco. The newest version out changed enough where the old integration methods don't seem to work. I have gotten everything fairly far on my own but I have hit a brick wall with this error:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Source Error:
Line 23: <img src="~/yaf/images/YAFLogo.jpg" runat="server" alt="YetAnotherForum" id="imgBanner" /><br/>
Line 24: <form id="form1" runat="server" enctype="multipart/form-data">
Line 25: <YAF:Forum runat="server" ID="yafForum" />
Line 26: </form>
Line 27: </body>
I have a feeling that YAF is not starting up the database. In previous versions of YAF there was an INIT module that you loaded in your web.config file. This module is no longer there (YAF.Base.YAFInitModule).

It looks like you're trying to run YAF in a .net 4.0 environment. The YAF assemblies, however, are built in .net 2.0. This could be the cause of your problems.
You can download the YAF source and change the project's properties to build to .net 4.0 instead.

I didn't come up with this but here is the solution from http://our.umbraco.org/forum/getting-started/installing-umbraco/11233-Umbraco-and-YAF?p=0:
Make sure your YAF installtion is really accessible. I know this sounds kind of odd, but I
had to alter YAF.FileRoot and
YAF.AppRoot several times until I got
it up and running again - see
app.config). The best way to test this
is to overwrite your main web.config
(the one from Umbraco with the default
web.config from YAF.Net and see if you
get the forum running in the subfolder
(or folder structure) For test
purposes you might have to temporarily
remove Form.browser from your
App_Browser directory as this file
caused a lot of parsing errors when I
only ran YAF.Net (which is pretty
clear as we do not have the right
references) Remove Umbraco Channels
path="umbraco/channels.aspx"
path="umbraco/channels/word.aspx" from
the web.config as they use a different
CookComputing.XmlRpcV2.dll than
YAF.Net does (apparently Umbraco uses
still a pretty old version)
Umbraco and YAF also differ in the CookComputing.XmlRpcV2.dll file. Umbraco uses 2.2.0.4 while YAF uses 2.4.0.0. You need to deploy the 2.4.0.0 version to your server's GAC to get this working right

Related

Identify the ASP.NET version of a site

I debug a site. I need to identify the .NET and ASP.NET version of the running site (on a local IIS).
When I have an .NET Error, the a page is displayed, like this:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please review the
specific error details below and modify your configuration file
appropriately.
Parser Error Message: Unrecognized attribute 'requestValidationMode'.
Note that attribute names are case-sensitive.
Source Error:
Line 120: Line 121: Line
122: Line 123: Line
124:
Source File: C:\mysite\opt\root\web.config Line: 122
Version Information: Microsoft .NET Framework Version: 4.0.30319;
ASP.NET Version: 4.6.1038.0
Is there a way to obtain that data in other way than a error message, to be able to identify that versions at demand?
I would like to stress that .NET and ASP.NET are different, and I need both of them.
PS. I would prefer, if possible do not have to modify the code, but rather via IIS...
You can try either of this below
typeof(Page).Assembly.GetName().Version; //ASP.NET Version
This gives your running ASP.NET version which in my case 4.0.0.0. You can find the same information if you expand your Reference folder -> find System.Web dll -> right click and choose properties -> check the Version information.
System.Environment.Version.ToString(); //Framework Version
This gives the version information of the CLR.
.NET Framework - registry check?
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full
https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx
Environment.Version
should give you the ASP.NET version

Viewer lines in License.licx breaking build process

I've recently been tasked with adding a report to an older WPF application. Part of the process involved adding ActiveReports to the solution in question.
After getting the report implemented and tested on my local machine, it came time to commit it up to our Dev/Test build environments. Everything went fine, until I attempted to run the application on a machine that did not have ActiveReports installed and licensed on it - I got the "Viewer needs to be licensed error window."
Here's where things get confusing, though. It should be working.
For starters, I'm running ActiveReports 8.0.133.0.
The contents of my licenses.licx file are:
GrapeCity.ActiveReports.SectionReport, GrapeCity.ActiveReports.v8, Version=8.0.133.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff
I've generated a satellite licensing DLL for the WPF project's executable, and ensured that it's referenced and set to Copy Local = true. (I've already dealt with this in the past.)
Even though it's not a web project, for safety's sake, I used the WebKey Generator and added an Active Report 8 Developer key to the app.config file.
It gets more interesting, though. When I add the following lines to my licenses.licx file, as the error window I get above suggests I should do:
GrapeCity.ActiveReports.Viewer.Win.Viewer, GrapeCity.ActiveReports.Viewer.Win.v8, Version=8.0.133.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff
GrapeCity.ActiveReports.Viewer.Wpf.Viewer, GrapeCity.ActiveReports.Viewer.Wpf.v8, Version=8.0.133.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff
When I try to simply build the project in Dev, the build fails with the following message:
[10:29:34] [exec] (CompileLicxFiles target) ->
[10:29:34] [exec] Properties\licenses.licx(2): error LC0004: Exception occurred creating type 'GrapeCity.ActiveReports.Viewer.Win.Viewer, GrapeCity.ActiveReports.Viewer.Win.v8, Version=8.0.133.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff' System.ComponentModel.LicenseException: License cannot be confirmed. Error code: 01-001 [C:\CheckoutDirectory\Project\[(0) BUILD]\UI\UI.csproj]
[10:29:34] [exec] Properties\licenses.licx(3): error LC0004: Exception occurred creating type 'GrapeCity.ActiveReports.Viewer.Wpf.Viewer, GrapeCity.ActiveReports.Viewer.Wpf.v8, Version=8.0.133.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff' System.ComponentModel.LicenseException: License cannot be confirmed. Error code: 01-001 [C:\CheckoutDirectory\Project\[(0) BUILD]\UI\UI.csproj]
For those who don't want to scroll:
System.ComponentModel.LicenseException: License cannot be confirmed. Error code: 01-001
The end result is a sort of Morton's Fork of badness. Either I can build the app, but I can't run the report (which, is sort of the point of me making these changes), or I simply can't build the app at all.
Question: What can I do to get the report viewer to run without a license exception and keep the application building? I should also note, I'm on a short deadline with this!
I was correct to add the Win and WPF viewer lines; it turns out the answer was to upgrade the Build server with Active Reports 8. From there, everything went swimmingly.
TL;DR - Upgrade everything that needs to be upgraded!

Adrotator issues with AdDuplex

I am trying to use AdRotator in my Windows Store application and I just installed it using the Nuget Package manager. I tried to run my app without adding any controls or code behind in XAML/C# Windows store app and it crashes throwing an exception about AdDuplex.
To be more precise I get the following exception
An exception of type 'System.IO.FileNotFoundException' occurred in AdRotatorWin8.DLL but was not handled in user code
Additional information: Could not load file or assembly 'AdDuplex.Windows, Version=8.0.2.0, Culture=neutral, PublicKeyToken=447cab5ae9276daf' or one of its dependencies. The system cannot find the file specified.
I do not plan to use AdDuplex in my app but without adding any code about AdDuplex I keep getting exceptions.
After uninstalling adrotator everything works fine again.
After checking with the packages output window AdDuplex was installed alongside AdRotator. How do I make my app work though?
My default Ad settings file consists only of this
<?xml version="1.0" encoding="utf-8"?>
<AdSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CultureDescriptors>
<AdCultureDescriptor CultureName="default">
<Probabilities Probability="50" AdType="PubCenter" AppID="test_client" SecondaryID="Image_728x90" />
</AdCultureDescriptor>
</CultureDescriptors>
</AdSettings
With numbers and IDs set up properly but obviously I cannot share them here.
The issues persists no matter what I do.
I tried downloading adDuplex but the only availiable version in Nuget is 8.0.5 which in theory should work (since the error is of an earlier version of AdDuplex) but still doesn't
Follow the instructions in this url : http://darkgenesis.zenithmoon.com/adrotator-for-windows-8/
I believe that you have to change
defaultApSettings.xml
remove AdDuplex and set the Ad service that you are going to use.
An alternative solution is to just download the AdDuplex package using Nuget but I believe that is not the best choice if you have already decided that you are not going to use it.
Turns out said version of AdDuplex had Issues with AdRotator and Adrotator has been updated to accomodate the new changes

mod_mono-2.10 barking on targetFramework in web.config

Yesterday I upgraded to OSX Mavericks and needed to reinstall mod_mono.
All my .net websites targeting asp.net 4.0 now bark:
System.Configuration.ConfigurationErrorsException
Error deserializing configuration section compilation: Unrecognized attribute 'targetFramework'
So I removed the 'targetFramework="4.0" attribute from the compilation line.
This results in another problem:
System.Configuration.ConfigurationErrorsException
Error deserializing configuration section pages: Unrecognized attribute 'controlRenderingCompatibilityVersion'.
So I then remove 'controlRenderingCompatibilityVersion="3.5"' from the pages line and got:
System.Configuration.ConfigurationErrorsException
Error deserializing configuration section pages: Unrecognized attribute 'clientIDMode'.
As the 'clientIdMode="AutoID"' is the only attribute left on the files node, I just completely removed the node.
Then it gets a System.TypeLoadException.
I haven't bothered to look into that problem. These sites were running perfectly well before the update, so there must be some configuration thing that I missed out.
AFAIKT I run the latest stable versions of all involved software.
Just intrigued by the fact that the youngest mod_mono I found here, dates from '14-Feb-2011 20:39'.
Please advise,
guivho.
I got this resolved using instructions at
http://www.mono-project.com/AutoHosting

One solution causing issues with an unrelated one?

Recently I've had a lot of trouble with a solution I've been working on so I decided to redo it from scratch. Basically, it's an ASP.NET application and a Web Service. I got everything to where it should be working. It's deployed to IIS, and when I try to debug I get: "Unable to start debugging on the web server. The web server is not configured correctly."
So I tried running without debugging and I get this error:
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify yourconfiguration file appropriately.
Parser Error Message: Could not load file or assembly 'BrowserInfoApp'
or one of its dependencies. This assembly is built by a runtime newer
than the currently loaded runtime and cannot be loaded.
Source Error:
Line 57: <add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 58: <add assembly="System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 59: <add assembly="*" />
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config Line: 59
Unsure of what this line did, I tried commenting it out. It still wouldn't let me debug on the server and this was the result of running without debugging again:
Parser Error
Description: An error occurred during the parsing of a resource required
to service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: Could not load type 'BrowserInfoApp.Global'.
Source Error:
Line 1: <%# Application Codebehind="Global.asax.cs" Inherits="BrowserInfoApp.Global" Language="C#" %>
Source File: /global.asax Line: 1
What is strange about this, is that BrowserInfoApp is completely unrelated. It is something that I made for testing, but the solution I am using now has never referenced it or been related to it. I started the solution I'm using now fresh, under an hour ago, so it's not a forgotten reference or anything like that.
I'm running everything on Windows XP with IIS 5.1.
So far I've tried removing the BrowserInfoApp virtual directory from IIS. If need be, I will try deleting the entire app, but I feel as if that's unecessary.
I really don't know where to go with this. If there is more information that I could provide, please let me know and I would be glad to do so.
Edit: I've tried deleting all of BrowserInfoApp and I get the same error.
Maybe you copy and pasted the reference to the BrowserInfoApp class when you rebuilt from scratch. Delete the Global.asax file and then re-add it, making sure it doesn't reference that assembly, which was built in a newer version.
Web.config files are hierarchical. Perhaps there's a web.config at a higher level of the virtual hierarchy which is referencing this other assembly.
In that case, you'll have to upgrade the applications in the higher levels of the hierarchy.
I solved the issue by removing "Inherits="BrowserInfoApp.Global"" from the Global.asax file. I also uncommented "add assembly="*" /" in my web.config file. I think I may have also had an issue with publishing to IIS (I named the site something different than the project name).
Not too sure what went wrong or why it works now, but it does.
I had the same issue. My setup: all my web apps were created as applications in the Default Web Site in IIS. I somehow managed to let one of my web projects in an unrelated solution create itself in the Default Web Site. So all my other solutions inherited the config settings, but they didn't have the required DLLs.

Categories