One solution causing issues with an unrelated one? - c#

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.

Related

ASP.Net error on server?

I have an ASP.Net site that pulls back data from a SQL database, it works in visual studio on my local machine but when i upload it to my web space at somee.com i get an error when i try to access the page.
Here i the error page :
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: Could not load file or assembly 'MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
Source Error:
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Source File: d:\DZHosts\LocalUser\bman262\www.brandonsLoginTest.somee.com\riviera horticulture\web.config Line: 9
Assembly Load Trace: The following information can be helpful to determine why the assembly 'MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1069.1
From what i can make of that, i don't think the
mysql.data
reference in the web config is getting loaded in.
Anyone help ?
Thank you
You either need to make sure that the missing DLL is included when you deploy your web site. If you use the VS deploy tool, it should do this for you.
Check your Publish folder and see if it's there.

Cannot Apply System.Web.Extensions to PartialTrustVisibleAssemblies List

In the web.config of webforms .net 4.5 application I set the following:
<trust legacyCasModel="true" level="Full" />
because this is a Microsoft work around to overcome an bug in the asp.net Report Viewer which causes large reports to take much longer to generate than in previous .net versions (3.5 and older). Unfortunately, enabling the legacy CasModel has caused the error below. As the error suggests I have attempted many times to apply an exception in my site's web.config such as:
<system.web>
<partialTrustVisibleAssemblies>
<add assemblyName="System.Web.Extensions" version="4.0.0" publicKey="0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9" />
</partialTrustVisibleAssemblies>
</system.web>
But the error still occurs. I also attempted to apply this setting to the .net 4 web.config and specify this assembly to have full trust but it still won't work. I've read a ton of documentation pertaining to this issue and I cannot locate any other way this issue maybe resolved (except to remove this assembly in my project or make other major changes to my web application). Any suggestions of how I can fix or address this issue would be greatly appreciated, Thanks.
Server Error in '/' Application.
Attempt by security transparent method 'Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode.Start()' to access security critical method 'System.Web.UI.ScriptManager.get_ScriptResourceMapping()' failed.
Assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is a conditionally APTCA assembly which is not enabled in the current AppDomain. To enable this assembly to be used by partial trust or security transparent code, please add assembly name 'System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9' to the the PartialTrustVisibleAssemblies list when creating the AppDomain.
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.MethodAccessException: Attempt by security transparent method 'Microsoft.ScriptManager.MSAjaxv45.PreApplicationStartCode.Start()' to access security critical method 'System.Web.UI.ScriptManager.get_ScriptResourceMapping()' failed.
Assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is a conditionally APTCA assembly which is not enabled in the current AppDomain. To enable this assembly to be used by partial trust or security transparent code, please add assembly name 'System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9' to the the PartialTrustVisibleAssemblies list when creating the AppDomain.
Try removing "Microsoft.ScriptManager.MSAjax.dll" and "Microsoft.ScriptManager.WebForms.dll" from references(if not used).
#Sachin, thank you for your answer however I need those assemblies for this project so that would not resolve this issue. I resolved this issue a while ago. I think this error was occurring when attempting some authentication functions in the application. I resolved the issue by setting the report function to open in a new application pool, so that the enabling of the legacy CAS model only effects the new application pool and therefore not effecting other authentication functions in the application.

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!

Conflicting System.Web.Http.Cors assembly in azure mobile services

Suddenly I got the following error when publishing to Azure Mobile Services.
"Error Found conflicts between different versions of the same dependent assembly 'System.Web.Http.Cors': 5.1.0.0, 5.2.2.0. Please change your project to use only one version. App.Hosting 2014-09-20 23:40:26"
I use Microsoft.AspNet.WebApi.Cors and WindowsAzure.MobileServices.Backend (1.0.348).
I have tried going through all references and I cant find any pointing at 5.2.2.0.
I have also tried upgrading to 5.2.2.0 however when doing so I get:
"Error Boot strapping failed: executing 'WebApiConfig.Register' caused an exception: 'Could not load file or assembly 'System.Web.Http.Cors, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.'. App.Hosting 2014-09-20 23:06:20"
I can not understand why I get this error and it seem to have start to occur with no apparent reason.
Any pointer is appreciated.
We are in the process of updating to the newly released ASP.NET Web API 5.2 and it looks like we missed an assembly redirect for the CORS assembly.
In a couple of days you will be able to use the full ASP.NET Web API 5.2 but the upgrade has to complete first. To fix your problem now, you should be able to just remove your own CORS assembly (assuming you are only setting the origins) and then set them using the MS_CrossDomainOrigins app setting in your local web.config as described in this blog [1], for example:
<add key="MS_CrossDomainOrigins" value="http://testhost, http://sample" />
Sorry for the inconvenience!
Henrik
[1] http://azure.microsoft.com/blog/2014/07/28/azure-mobile-services-net-updates/

Umbraco and YAF

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

Categories