This application was working fine in an earlier server and when we ported it to a new server we are getting this issue. What could be the real issue behind this error ? kindly suggest
The error that we get is as follows :
Server Error in '/' Application.
Stream does not support writing.
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.NotSupportedException: Stream does not support writing.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%# Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[NotSupportedException: Stream does not support writing.]
System.IO.__Error.WriteNotSupported() +56
System.IO.BufferedStream.WriteByte(Byte value) +43
MySql.Data.MySqlClient.PacketWriter.FlushBuffer() +112
MySql.Data.MySqlClient.PacketWriter.Flush() +68
MySql.Data.MySqlClient.NativeDriver.Authenticate411() +140
MySql.Data.MySqlClient.NativeDriver.Authenticate() +68
MySql.Data.MySqlClient.NativeDriver.Reset() +45
MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() +207
MySql.Data.MySqlClient.MySqlPool.GetConnection() +52
MySql.Data.MySqlClient.MySqlPoolManager.GetConnection(MySqlConnectionString settings) +228
MySql.Data.MySqlClient.MySqlConnection.Open() +152
RemoteDB.OpenRemoteDataConnection() +156
RemoteDB.RemoteRecordFound(String tblname, String fldname, String txt, String SCond) +14
admin_Default.btnLogin_Click(Object sender, EventArgs e) +97
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.5472; ASP.NET Version:2.0.50727.5456
Appreciate your kind help in resolving this issue. This application is built on mysql db and asp.net version used for this site is 2.0
regards
venkat
Related
I am trying to add ADO.NET Entity Data Model generated from MySql Database(8.0.21.0), I have installed everything as expected (MySql Connector, MySql for Visual Studio) and after selecting the tables I want to include I receive the below exception.
MySql 8.0.21.0, Visual Studio 2019, Entity framework 6.4.4, Console Application
Unable to generate the model because of the following exception: 'System.Data.Entity.Core.EntityCommandExecutionException:
An error occurred while executing the command definition.
See the inner exception for details.
---> MySql.Data.MySqlClient.MySqlException: Fatal error encountered during command execution.
---> MySql.Data.MySqlClient.MySqlException: Fatal error encountered attempting to read the resultset.
---> MySql.Data.MySqlClient.MySqlException: Reading from the stream has failed.
---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
--- End of inner exception stack trace ---
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
--- End of inner exception stack trace ---
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
--- End of inner exception stack trace ---
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.EntityFramework.EFMySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<Reader>b__c(DbCommand t, DbCommandInterceptionContext`1 c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.Execute(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Entity.Core.EntityClient.EntityCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.Entity.Design.VersioningFacade.ReverseEngineerDb.SchemaDiscovery.FunctionDetailsReader..ctor(EntityCommand command, Version storeSchemaModelVersion)
at Microsoft.Data.Entity.Design.VersioningFacade.ReverseEngineerDb.SchemaDiscovery.EntityStoreSchemaGeneratorDatabaseSchemaLoader.LoadFunctionDetails(IEnumerable`1 filters)
at Microsoft.Data.Entity.Design.VersioningFacade.ReverseEngineerDb.SchemaDiscovery.EntityStoreSchemaGeneratorDatabaseSchemaLoader.LoadStoreSchemaDetails(IList`1 filters)
at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelGenerator.GetStoreSchemaDetails(StoreSchemaConnectionFactory connectionFactory)
at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelGenerator.CreateStoreModel()
at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelGenerator.GenerateModel(List`1 errors)
at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelBuilderEngine.GenerateModels(String storeModelNamespace, ModelBuilderSettings settings, List`1 errors)
at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelBuilderEngine.GenerateModel(ModelBuilderSettings settings, IVsUtils vsUtils, ModelBuilderEngineHostContext hostContext)'.
Loading metadata from the database took 00:00:00.4895530.
Generating the model took 00:00:09.6119343.
I've been struggling with the same problem for 2 days. I was using MySQL 8.0.18 (Server, NET Connector etc.), MySql for Visual Studio v1.2.9, nuget packages: MySql.Data + MySql.Data.EntityFramework and everything was working just fine a month a ago. Last week i updated the nuget packages to v8.0.21 and the db connection got disturbed so i updated my MySql to version v8.0.21. I made changes to the database and when i used the ADO.NET Entity Data Model wizard, i got the same exception. Tried everything but it did not work so i did the following to go back to the past working state:
Note: If you plan to follow, I advise you to follow in this order:
First install MySql for Visual Studio v1.2.9
Create all your current MySql database backups. Uninstall MySql completely from your system with the help of this guide Completely Uninstall MySql. Then restart your system.
Download and Install MySql v8.0.18 (all components including NET Connector)
Restore all your databases back in this installed version.
In your project, you may also have to downgrade the packages. I downgraded EntityFramework to v6.2.0, MySql.Data and MySql.Data.EntityFramework to v8.0.18
Now Create a new ADO.NET Entity Data Model and things should work this time.
I tried everything using the latest versions of MySql v8.0.21 and packages but couldn't get things to work. One possible reason could be that the MySql NET Connector and the target .NET framework version of your application may be incompatible with each other. It may also be the same case between MySql NET Connector version and Visual Studio version. This may not be the actual solution to your problem but it's one way of getting it to work.
I've checked this for MySQL 8.0.22 it works fine.
I had these errors in 8.0.21 too. So i decided to check upgrade instead of downgrade. It's really ubset that we are getting this problems with 'new' version.
Also, if you had project configured with MySQL Configuration Tool for previous version run it, uncheck 'Use MySQL with Entity Framework', click Finish. Reopen and check it.
I didn't just upgrade it, firstly i've deleted 8.0.21 through MySQL Installer (didn't use complete uninstall at all). And after it i have installed newest version. MySQL Visual Studio Tool i install separately by other .msi from MySQL downloads page
I found a combination of versions of MySql.Data, MySql.Data.Entrityframewor, MySql Connector NET and definition of the project's .config file, with which it is possible to create an ADO.NET Entity Framework model from a MySQL 8.0.11 database . However, I found another error running the code of a query with DbContext, and of which, I also found another solution.
To test these solutions, I suggest using a test computer in which you can completely remove all MySQL components, and even modify the Windows registry if necessary.
SOLUTION 1. CREATE ADO.NET ENTITY FRAMEWORK MODELS.
Completely uninstall all MySQL components as explained
Install MySQL 8.0.11. Do not include NET 8.0.11 connector. For non-MySQL expert users like my case, install using MySQL Installer, and also do the basic MySQL configuration with this tool. Restart the computer.
Download and install mysql-connector-net-8.0.23.msi: from
https://dev.mysql.com/downloads/connector/net/
Download and install mysql-for-visualstudio-1.2.9.msi (it is the latest version available): this is because MySQL Installer 8.0.11 does not show it in the components to install. Download it from https://dev.mysql.com/downloads/windows/visualstudio/
With MySQL Workbench or similar tool, create a database and test table in MySQL.
Using VS2019 Community using the Server Explorer create a connection to the test database. Check it out.
Using VS2019 Community create .NET Framework 4.5.2 console application as is, without installing any Nuget package. I suggest creating a new app while verifying that the solution works. I have not tested with .NET Core.
In Server Explorer select and open the connection to MySql. In the Solution Explorer select the console project created. Now in the upper right corner click on the icon of the MySQL Application Configuration tool. It is explained at https://dev.mysql.com/doc/visual-studio/en/visual-studio-app-config-ef.html.
This tool automatically installs the required Nuget packages based on the version of Entity Framework, MySQL Connector .NET. It also modifies the project's .config file.
Nuget Packages:
EntityFramework v6.1.3 by Microsoft
MySql.Data v8.0.23 by Oracle
MySql.Data.EntityFramework v8.0.23 by Oracle
App.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.20, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<entityFramework>
<defaultConnectionFactory type="MySql.Data.EntityFramework.MySqlConnectionFactory, MySql.Data.EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.20, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
Create an ADO.NET Entity data model from the MySQL database. In my case, the Visual Studio wizard did the whole process without any problem, and the model was created with the selected tables.
PROBLEM 2:
I was happy after several failed attempts and readings of posts on the matter. But it didn't last long for me, because when testing a simple query using the generated DbContext with the ADO.NET Model, an error was thrown.
CONSULTATION:
TelefonosEntities db = new TelefonosEntities ();
var data = db.Nombres.ToList ();
ERROR:
System.Data.Entity.Core.EntityCommandExecutionException
HResult = 0x8013193C
Message = An error occurred while executing the command definition. See the inner exception for details.
Source = EntityFramework
StackTrace:
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands (EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute [TResultType] (ObjectContext context, ObjectParameterCollection parameterValues)
at System.Data.Entity.Core.Objects.ObjectQuery`1. <> c__DisplayClass7. <GetResults> b__6 ()
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction [T] (Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectQuery`1. <> c__DisplayClass7. <GetResults> b__5 ()
at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute [TResult] (Func`1 operation)
at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults (Nullable`1 forMergeOption)
at System.Data.Entity.Core.Objects.ObjectQuery`1. <System.Collections.Generic.IEnumerable <T> .GetEnumerator> b__0 ()
at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext ()
at System.Collections.Generic.List`1..ctor (IEnumerable`1 collection)
at System.Linq.Enumerable.ToList [TSource] (IEnumerable`1 source)
at ConApp2.Program.Main (String [] args) in C:\Users\alicia\source\repos\CoNApp1\ConApp2\Program.cs: line 46
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
MySqlException: Table 'telefonos.telefonos.nombres' doesn't exist
CAUSE: it is the MySQL Connector NET v8.0.23, and it also happens with the version v8.0.22, v8.0.21. See https://bugs.mysql.com/bug.php?id=101236
SOLUTION 2:
I did several failed tests of combinations of MySQL, MySQL Connector, but the one that finally solved the problem for .NET Framework projects was the following:
MySQL:
MySQL v8.0.20 or MySQL v8.0.23
MySql Connector v8.0.20
MySql for Visual Studio 1.2.9
Nuget Packages:
EntityFramework v6.1.3
MySQL CONNECTOR NET v8.0.20.
MySql.Data v8.0.20
MySql.Data.EntityFramework v8.0.20
PROBLEM 3:
In .Net Framework 4.5.2 web projects, the Ado.Net Entity Framework data model creation wizard closes automatically after selecting the MySql connection to use.
TEMPORARY SOLUTION 3:
Use a .NET Class Library project to use the Ado.Net Entity Framework data model, and reference it in the web project.
I have a .NET 3.5 project with a corresponding unit test project.
First of all, since the Update to VS 2013 I cannot longer run the test project with MSTest. I learned that vstest.console.exe is the new preferred way to execute the tests.
Nevertheless, during the test run with vstest.console.exe which executes 550 UnitTests, all of them successful, my console gets spammed with a LOT of these exceptions:
Warning: System.Runtime.Serialization.SerializationException: Unable to find assembly 'Moq, Version=4.2.1402.2112, Culture=neutral, PublicKeyToken=69f491c39445e920'.
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap.Create(String name, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.AppDomain.Deserialize(Byte[] blob)
at System.AppDomain.UnmarshalObject(Byte[] blob)
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap.Create(String name, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.AppDomain.Deserialize(Byte[] blob)
at System.AppDomain.UnmarshalObject(Byte[] blob)
I don't know what I did wrong.
I can only guess that because the tests are executed in Isolation mode (probably because of .NET Framework 3.5), it needs to transfer some objects between app domains, and here these exceptions occur.
My Question is:
Why can't the assembly be located? The Moq.dll is right beside my unit test assembly. What can I do to prevent these hundreds of exception messages during the test run?
Update:
I was being asked to run the fusion logger alongside, and it gave me this info:
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\vstest.executionengine.x86.clr20.exe.Config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Moq, Version=4.2.1402.2112, Culture=neutral, PublicKeyToken=69f491c39445e920
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 12.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Moq.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 12.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Moq/Moq.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 12.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/Moq.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 12.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/Moq/Moq.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 12.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Moq.EXE.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 12.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Moq/Moq.EXE.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 12.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/Moq.EXE.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 12.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/Moq/Moq.EXE.
LOG: All probing URLs attempted and failed.
Now, I am asking why it does not use the Assemblies provided with my test project.
I cannot copy the Moq.dll to any of these paths, since I run multiple test projects in the same test run that use different versions of some assemblies and I could only provide one specific version here.
I was getting similar warnings on the build machine. The reason turned-out to be MockExceptions being thrown during the unit tests execution (All tests were successful even in my case, because of async-await weirdness).
Trick to identify these exceptions is to 'Debug' the unit tests instead of 'Running' (Right click and select Debug Selected Tests at project level). Fixing these MockExceptions got rid of the build warnings for me. Hope this helps.
Okay, I found the issue.
It seems that in the Moq NuGet package the Moq.dll in the lib\net35\ Folder is a dll built against .NET 4, and this cannot be loaded when the test is run in a .NET 3.5 environment.
A .net application works at a server which SQL Server 2005 , now we relocate the application to the new server which is SQL Server 2008.
Below is the error when I try to get a report from application:
Server Error in '/Importal' Application.
The request failed with HTTP status 404: Not Found. 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.Net.WebException: The request failed with
HTTP status 404: Not Found.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The request failed with HTTP status 404: Not Found.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall) +431225
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) +204
Microsoft.SqlServer.ReportingServices2005.Execution.ReportExecutionService.LoadReport(String
Report, String HistoryID) +69
Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String
Report, String HistoryID) +67
[MissingEndpointException: The attempt to connect to the report server
failed. Check your connection information and that the report server
is a compatible version.]
Microsoft.SqlServer.ReportingServices2005.Execution.MissingEndpointException.ThrowIfEndpointMissing(WebException
e) +4027725
Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String
Report, String HistoryID) +107
Microsoft.Reporting.WebForms.ServerReport.GetExecutionInfo() +121
Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1
parameters) +67 ImportPerformanceKPI.btnList_Click(Object sender,
EventArgs e) +425
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1565
You will need to configure Reporting Services on your new SQL Server if it's not configured.
You've probably done that.
Inside the error, we have:
[MissingEndpointException: The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version. ]
Next make sure that your application is pointed at the new instance of SQL Server (it was looking for a 2005 instance). And then check that your application will work with SSRS 2008.
I need a small help
I have created a small physioit app for windows phone 8.
I have added facebookclient loginbutton in my xaml file.
Now when there is no data connection in my phone and when I run the code, it gives me TargetInvocationException and my app crashes.
Here is the exception I am getting –
innerException
{Facebook.WebExceptionWrapper: The remote server returned an error: NotFound. --->
System.Net.WebException: The remote server returned an error: NotFound.
at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClasse.<EndGetResponse>b__d(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass1.<BeginOnUI>b__0(Object sendState)
--- End of inner exception stack trace ---}
System.Exception {Facebook.WebExceptionWrapper}
How can I catch this exception?
I am using the facebook sdk to create the loginbutton
Here is the code snippet
<facebookControls:LoginButton
x:Name="loginButton"
Grid.Row="2"
Margin="5"
HorizontalAlignment="Right"
FetchUserInfo="True"
ApplicationId="xxxxxx"
SessionStateChanged="OnFacebookSessionStateChanged"
UserInfoChanged="OnFacebookUserInfoChanged"
AuthenticationError="LoginButtonAuthenticationError" />
Can you please help me out.
You could use NetworkInterface to check whether data connection is available or not and then allow the login button to do its action.
Something like this..
if(System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
//Allow login button
else
//Message user - no internet connection
Im using VS 2010 MVC3, I set up the web.config to connect to my remote database. When I debug its runs ok, registers, logs in fine. But when I upload it to the host i get this error:
Security Exception Description: The application attempted to perform
an operation not allowed by the security policy. To grant this
application the required permission please contact your system
administrator or change the application's trust level in the
configuration file.
Exception Details: System.Security.SecurityException: Request for the
permission of type 'System.Security.Permissions.SecurityPermission,
mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Request for the permission of type
'System.Security.Permissions.SecurityPermission, mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.]
MySql.Data.MySqlClient.MySqlConnectionStringBuilder.CreatePermissionSet()
+0 MySql.Data.MySqlClient.MySqlConnectionStringBuilder.DemandPermissions()
+38 MySql.Data.MySqlClient.MySqlConnection.PermissionDemand() +94 MySql.Data.MySqlClient.MySqlConnection.Open() +196
MySql.Web.Common.SchemaManager.GetSchemaVersion(String
connectionString) +65
MySql.Web.Common.SchemaManager.CheckSchema(String connectionString,
NameValueCollection config) +39
MySql.Web.Security.MySQLRoleProvider.Initialize(String name,
NameValueCollection config) +462
System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings
providerSettings, Type providerType) +419
Im using MySQL Connector Net 6.5.4
Thats a common Problem which a lots of people having.Thats because you build your website in Full trust level.That allows you to do nearly everything by IIS.But a lots of hosting company allows just Medium trust level.So you need to recode necessary parts of your project under Medium trust level.
Open ;
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config
folder and open webconfig file,and change line;
<trust level="Full" originUrl="" />
to
<trust level="Medium" originUrl="" />
Honestly I don't have a deep knowledge about further step and your assemblies.So I can help that much.
My friend had the same problem. He managed it adding the following setting in the MySql Connection String:
includesecurityasserts=true