Error with <add assembly="System.Data.SqlClient, Version=10.50.1600, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> - asp.net

Why do I get this error? How I can fix it? I'm connecting from Web.config in an application that I started to do but I finish school issues because it is a team effort. The teacher has told me I should put that online so that my connection is well made ​​but not if publicToken or something else this evil at the time of writing the line is enclosed in asterisks. I need to indicate that I am writing wrong Please will thank you.
Server Error in '/' Application.
Configuration Error
Description: Error during processing of a configuration file required to service this request. Check the specific error details below and modify your configuration file accordingly.
Parser Error Message: Could not load file or assembly 'System.Data.SqlClient, Version = 10.50.1600, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a'or one of its dependencies. The system can not find the file specified.
Source Error:
Line 51: <add assembly="System.Data.Services, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Line 52: <add assembly="System.Data.Services.Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Line 53: **<add assembly="System.Data.SqlClient, Version=10.50.1600, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>**

In .NET there is no such assembly as System.Data.SqlClient, Version=10.50.1600, .... SqlClient is the part of standart .NET Framework distribution.
For example, System.Data.SqlClient.SqlConnection:
Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)
How to determine fully qualified assembly name
Download the previous, free version of .NET Reflector, load assembly into (simply drag it onto) and you will see it's FQN

Have you checked to make sure that the dll indicated is being deployed and that the version number matches the version you specify above? The error is pretty clear. The system can't find the assembly that the code refers to on this line.

Well, you can browse the GAC (Global Assembly Cache) for meet the assembly data. Use the following command from de command prompt :
gacutil -l
This list the content of the GAC with the information that you need.

Related

Compilation error at runtime from Microsoft.AspNet.WebApi.HelpPage version 4.0.30506

I am getting the following error when I try to use version 4.0.30506 (unfortunately we are tied to this version of ASP.NEt Web API for now) of the Microsoft.AspNet.WebApi.HelpPage nuget package. I am using Windows 7 and .NET 4.5.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0012: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Source Error:
Line 11:
Line 12: // Group APIs by controller
Line 13: ILookup<string, ApiDescription> apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor.ControllerName);
Line 14: }
Line 15:
As far as I can see I have all the correct references for this to work. I have tried looking for a System.Runtime assembly as it suggests, but I can't find it on my system. I have added using statements to the top of Index.cshtml, but with no affect.
#using System
#using System.Runtime
Any suggestions of what is causing this error?
check your web.config:
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
</compilation>
In my case, this error disappeared when I removed System.Collections.Immutable.dll from Bin directory. This DLL is from NuGet package and is available only for Win8 platforms and I was working with Win7. So it might help you too..
I ran into this error after updating all Nuget packages in an MVC 5, .NET 4.5.1 project, and thanks to Dmitry Lyalin's post discovered the issue related to an updated Nuget package that has become a Portable Class Library.
For those who like to dig, I figured out the culprit by doing the following:
Unload the project
Edit the project
Search for "portable"
Having found Humanizer, I changed it back to pre-PCL version 1.37.7, retested the page, and found that everything worked again.
Knowing the culprit(s), Humanizer in my case, there's two options:
Cap the Humanizer Nuget at version 1.x.y so as not to use the new PCL libraries in v2 via allowedVersions attribute in packages.config:
<package id="Humanizer " version="1.37.7" allowedVersions="[1,2)" />
Do what giammin suggests in his answer and add the System.Runtime assembly under system.web in web.config:
<system.web><compilation ...><assemblies><add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /></assemblies></compilation></system.web>

crystal reports error in silverlight application on installation

I have pubslihed an silverlight application which has crystal reports in the IIS server it shows me the error as below could any one help me to resolve
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 'CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 32: <add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
Line 33: <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
Line 34: <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
Line 35: <add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
Line 36: <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
Based on teh error message, it seems that the crystal report version installed on your system does not match the crystal report version you used on your code. Please double check it so that you can sync the crystal report version for your site.
Besides, there are several requirements to run Crystal Report properly:
Please make sure the CR version installed on the server matches the one you use on your application/website
Please make sure that the assemblies of the CR installed on the server are referenced correctly on your web.config
Please make sure you set the application pool of your application to operate under LOCAL SERVICE permission
Please make sure FULL TRUST mode is enabled on your operating folder
Please make sure crystalreportviewer and aspnet_client folders are copied to your operating folder.
I have been using Crystal Report for a while. I have also tried the latest Crystal Report for VS 2010 and initially, I experienced the problem like you do now. By following all the steps above, your CR will certainly work fine. Should you still have problems, you can consider hosting it withasphostcentral.com
Please mark this response as an "answer" if it helps you. Thanks heaps!

Error while running a test: "You must add a reference to assembly..."

I am trying to launch a test but I obtain this error
The type 'System.Web.Security.MembershipUser' is defined in an
assembly that is not referenced. You must add a reference to assembly
'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'.
I looked for google and found that I have to Add Reference System.Web.ApplicationServices to my project, i do it but still dont work.
I wrote it in web.config to but nothig, I obtain the same error
<assemblies>
<add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
Any idea!!! Thanks.
When do you get this problem? When building your project, or when actually running the test?
If you get it when you build your project, follow these steps to see if it resolves your problem:
1 - Search your machine for this file: "System.Web.Security.MembershipUser.dll"
2 - Once you find it, open your project and choose the "Add Reference" menu command
3 - Choose the file you found in step 1

"Invalid token ',' in class, struct, or interface" after checkout

I am having problems compiling an EPiServer Web Application after checking it out of Subversion.
I get this error
Compiler Error Message: CS1519: Invalid token ',' in class, struct, or interface member declaration
Source Error:
Line 116: }
Line 117:
Line 118: public virtual EPiServer.Personalization.SubscriptionInfo, EPiServerSubscription Info {
Line 119: get {
Line 120: return ((EPiServer.Personalization.SubscriptionInfo, EPiServer)this.GetPropertyValue("SubscriptionInfo")));
Source File:
c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\956e6fc5\66c11597\App_Code.9_fan95p.0.cs Line: 118
As you can see from the error, this file is in the "Temporary ASP.NET Files" folder and is part of the build process. This is not my source code.
I have seen this question which suggests that the web config contains type references
specified in the "Namespace.ClassName,
AssemblyName" format.
So I went into my web.config and changed the section
...
<profile ...>
<properties>
...
<add name="SubscriptionInfo"
type="EPiServer.Personalization.SubscriptionInfo, EPiServer"
provider="SqlProfile" />
...
to
...
<profile ...>
<properties>
...
<add name="SubscriptionInfo"
type="EPiServer.Personalization.SubscriptionInfo"
provider="SqlProfile" />
...
This removed the immediate error above but then I got the same error for a different type. So I went through all the types that were in "Namespace.TypeName, AssemblyName" format and removed the ", AssemblyName". This stopped all the CS1519 errors but then I start getting CS0234:
Compiler Error Message: CS0234: The
type or namespace name
'Personalization' does not exist in
the namespace 'EPiServer' (are you
missing an assembly reference?)
Source Error:
Line 116: }
Line 117:
Line 118: public virtual EPiServer.Personalization.SubscriptionInfo
SubscriptionInfo {
Line 119: get {
Line 120: return
((EPiServer.Personalization.SubscriptionInfo)(this.GetPropertyValue("SubscriptionInfo")));
I am using VisualStudio 2008, Episerver 5.2.372.7, VisualSVN 1.7.2 and a Debian box as the Subversion repo running svn version 1.4.2 (r22196).
The application built fine, then I checked it in to the repo. Checked it out to a different location on the same computer and hit F5 and these errors start to appear.
Does anyone have any suggestions.
UPDATE:
Thanks for your replies devio, Zhaph.
I have added the following to my web.config in the <compilation> section:
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="EPiServer, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
<add assembly="EPiServer.BaseLibrary, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
<add assembly="EPiServer.Configuration, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
<add assembly="EPiServer.Enterprise, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
<add assembly="EPiServer.Implementation, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
<add assembly="EPiServer.Lucene, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
<add assembly="EPiServer.Scheduler, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
<add assembly="EPiServer.Web.WebControls, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
<add assembly="EPiServer.WorkflowFoundation, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
<add assembly="EPiServer.Wsrp, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
<add assembly="EPiServer.XForms, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
</assemblies>
There was no <assemblies> section previously.
The project has all of those DLLs in its References. All the EPiServer DLLs are in the GAC.
The new (non-working) checkout is on the same machine that the original project was created on.
I now get :
Parser Error Message: Could not load
file or assembly 'EPiServer.Scheduler'
or one of its dependencies. The system
cannot find the file specified.
(C:\Projects\web\ProvidentPPC2\ProvidentPPC\web.config line 301)
Source Error:
Line 299: <add name="InitializationModule" type="EPiServer.Web.InitializationModule" />
Line 300: <!--<add name="BasicAuthentication" type="EPiServer.Security.BasicAuthentication, EPiServer" />-->
Line 301: <add name="Initializer" type="EPiServer.Scheduler.Initializer, EPiServer.Scheduler" />
Line 302: <add name="WorkflowRuntime" type="EPiServer.WorkflowFoundation.WorkflowSystem" />
Line 303: <add name="UrlRewriteModule" type="EPiServer.Web.UrlRewriteModule" />
Source File:
C:\Projects\web\ProvidentPPC2\ProvidentPPC\web.config
Line: 301
As I say EPiServer.Scheduler is in my GAC and added to the project as a reference.
Any more ideas would be greately appreciated.
I encountered this problem as I was restructuring the dll references in a project.
I had moved the external/third part dlls from the bin folder to a library folder outside the web project root.
My problem was that some of the dll references did not have copy local set to true, so they were never copied to the bin folder on build.
It's been a while since I asked this and I keep looking thinking that I need to remember what the issue was and post the answer. I think this is it.
It turned out that there was an issue with application finding the DLLs that EPiServer installed. I'm not sure exactly and I'll update this post once I get chance to try it out on a clean machine, I'm still mid-project so it's not a very good time to be faffing about.
The way I fixed it was to get the DLLs from c:\Program Files\EPiServer\CMS\VERSION\bin and put them in the bin folder for the application.
Once I get chance to do a clean install somewhere I'll see if it is infact the project (which I doubt) or, more likely, the installation on my computer which is broken.
Have you tried referencing the EPiServer assembly correctly?
I assume that it's displaying ok in the project references node in the Solution Explorer, and hasn't got a yellow exclaim overlay on it?
Perhaps you could reference it in the web.config compilation section as well:
<compilation debug="false">
<assemblies>
[...]
<add assembly="Episerver, Version=5.2.372.7"/>
</assemblies>
</compilation>
You may either not need the version number, or you may need to add the version number and culture type - there should be a few other assemblies referenced in there already for reference.
You could also try:
<add assembly="EPiServer" />
and other variations.
Sounds like an Assembly Load issue then:
Check that the EPiServer DLL is accessable in your new location - is it installed to your computers Global Assembly Cache, or is it a local reference to the /bin folder? Is the dll in the bin folder? Is the dll included in source control?
I ran into this several times and done it for me is when I manually copied the EPiServer assemblies to the bin folder. That works for sure but it's not very elegant. Zhaph's solution with the assemblies tag looks much nicer I'll try it next time.
I just had a similar problem this afternoon. The problem was that the EpiServer dlls were not present in the bin directory of the website, so I got bind failures.
The project had been created by one of my colleagues and the relevant EpiServer dlls were added as solution items in a lib folder and referenced from there. However, as he had initially created it from the EpiServer project template, the libraries had automatically been added to the bin folder also. When he updated the references to point to the lib folder, copy local defaulted to false. This still worked on his machine due to the original copies placed in the bin folder by the template. Updating them to CopyLocal = True fixed the issue.
I just had this same problem, again with an EPiServer site. It was because I was referencing the EPiServer DLLs, but they did not have the "copy to local" property set to true on all the references, and so they were not all being placed in the bin directory.
Delete everything from BIN Folder and copy all the files from [ASSEMBLIES] in to BIN Folder fixed the problem for me.
Khizer Jalal
I guess the original error message meant you had a malformed C# expression in
return ((EPiServer.Personalization.SubscriptionInfo, EPiServer)...
nothing to do with the config file.
Probably you typed "," instead of "." ? (As the compiler reads this, you provide 2 types in the cast)
Revert web.config to its original version and fix the typo, that should work.
update after Greg's comment:
I didn't realize the config section you posted were part of the EPIServer configuration. You were right then to remove the assembly names.
However I guess you need to reference the EPiServer from the web app (Add Reference...). I think I noticed this in my projects too: If you checkout an ASP.Net app to a new location, you need to add all references again.

Configuration error after deploying asp.net files into iis server alternative

I am getting the following error which deploying my code in the production server. Code is working fine in development.
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 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (E:\QA\form\web.config line 103)
Source Error:
Line 101: </httpHandlers>
Line 102: <httpModules>
Line 103: <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 104: </httpModules>
Line 105: </system.web>
Source File: E:\QA\form\web.config Line: 103
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
I know this is because :
The server doesn't have .NET 3.5 SP1 installed on it. and code is depending on the .Net 3.5 runtime, but my server only has .Net 2.0.I need at least the ASP.NET AJAX 1.0 download, which should run with .Net 2.0.
But unfortunately i cannot install any of these in my production server. Do we have any other fix for this?
No. If you can't install the dependencies your application requires on the production server, then you must either (1) remove the dependencies from your application that are not present in your production environment (i.e. do things another way); or (2) not deploy in that environment. But, it seems strange that you would not be able to install the latest version of the Framework. Also, you should probably try and better understand the restrictions of your production environment before you develop to a certain Framework level.

Resources