IN SSISDB not able to create new folder - ssis

While I'm creating a folder in Integration service catalog - SSISDB i'm getting an error as below,
TITLE: Microsoft SQL Server Management Studio
------------------------------
Operation 'Create' on object 'CatalogFolder[#Name='dev']' failed during execution. (Microsoft.SqlServer.Management.Sdk.Sfc)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
An error occurred in the Microsoft .NET Framework while trying to load assembly id 65536. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error: 
System.IO.FileLoadException: Could not load file or assembly 'microsoft.sqlserver.integrationservices.server, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A)
System.IO.FileLoadException: 
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
Cannot find the folder 'dev' because it does not exist or you do not have sufficient permissions. (Microsoft SQL Server, Error: 10314)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.5058&EvtSrc=MSSQLServer&EvtID=10314&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
I have tried while Deploying the package in SSIS I'm getting the same error.
Why am I getting this error? Is there any way to create folder in SSISDB?

This error could occur when you change the database owner (db_owner) or the db was moved to another server. These are possible reasons.
Run this script and try again:
ALTER DATABASE SSISDB SET TRUSTWORTHY ON;

Related

ADO.NET Entity Data Model fails to be created from MySql Database + using Visual Studio

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.

Error Validating SSIS Package When Attempting to Run in 32 Bit Mode Within SSMS

I have a SSIS package that is currently deployed to my SSISDB. This package is required to run in 32Bit mode and does fine when I change the '64BitRuntime' setting to false within SSDT.
My issue comes about when I try to run it in 32 bit mode after it has been deployed to my SSISDB. My error occurs at the following screen:
The accompanying error is as follows:
The path for 'ISServerExec.exe' cannot be found. The operation will now exit.
A .NET Framework error occurred during execution of user-defined routine or aggregate "validate_package_internal":
System.Data.SqlClient.SqlException: The path for 'ISServerExec.exe' cannot be found. The operation will now exit.
System.Data.SqlClient.SqlException:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnectionSmi.EventSink.DispatchMessages(Boolean ignoreNonFatalMessages)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQuerySmi(Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteToPipe(SmiContext pipeContext)
at Microsoft.SqlServer.Server.SqlPipe.ExecuteAndSend(SqlCommand command)
at Microsoft.SqlServer.IntegrationServices.Server.ServerConnectionControl.RaiseError(SysMessageId messageId, SysMessageSeverity severity, Object[] args)
at Microsoft.SqlServer.IntegrationServices.Server.ServerApi.ValidatePackageInternal(SqlInt64 projectId, SqlInt64 package_id, SqlInt64 versionId, SqlInt64 validationId, SqlString targetEnvironment, SqlInt16 use32BitRuntime)
. (Microsoft SQL Server, Error: 27108)
How can I work through this issue? the only thing I'm finding through Google are how to mark the checkbox...
if you upgrade SQL recently, it may be issue with paths stored in ssisdb catalog. in my case, drop & create new catalog & deploy project, fixed Error 27108 while executing package from stored procedure.
hope it helps.

How to avoid SerializationException warnings with Vstest.console.exe and Moq

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.

.net application with mysql db error

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

Exception after upgrade to June 2012 SDK

I had a project up and running with the November 2011 SDK and recently upgraded to the June 2012 SDK. When I first saw the error, I attempted the obvious - remove references and add the later versions, but that didn't help. Somehow it seems that version 1.0.0.0 is still being requested. I've also attempted to remove the reference and add the old version back, but no luck.
Here's how it shows up in my code. The first Trace.WriteLine that hits now reports the following exception:
System.IO.FileLoadException was unhandled by user code Message=Could
not load file or assembly 'Microsoft.WindowsAzure.Diagnostics,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The located assembly's manifest definition
does not match the assembly reference. (Exception from HRESULT:
0x80131040) Source=mscorlib
FileName=Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35 FusionLog====
Pre-bind state information === LOG: User = NT AUTHORITY\NETWORK
SERVICE LOG: DisplayName = Microsoft.WindowsAzure.Diagnostics,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified) LOG: Appbase =
file:///F:/SVNProjects/myproject/SitePagesWebRole/ LOG: Initial
PrivatePath = F:\SVNProjects\myproject\SitePagesWebRole\bin Calling
assembly : (Unknown).
=== LOG: This bind starts in default load context. LOG: Using application configuration file:
F:\SVNProjects\myproject\SitePagesWebRole\web.config LOG: Using host
configuration file:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config LOG:
Using machine configuration file from
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.WindowsAzure.Diagnostics,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 LOG:
Attempting download of new URL
file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary
ASP.NET
Files/root/b117acb8/f2404402/Microsoft.WindowsAzure.Diagnostics.DLL.
LOG: Attempting download of new URL
file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary
ASP.NET
Files/root/b117acb8/f2404402/Microsoft.WindowsAzure.Diagnostics/Microsoft.WindowsAzure.Diagnostics.DLL.
LOG: Attempting download of new URL
file:///F:/SVNProjects/myproject/SitePagesWebRole/bin/Microsoft.WindowsAzure.Diagnostics.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor
Version ERR: Failed to complete setup of assembly (hr = 0x80131040).
Probing terminated.
StackTrace:
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName,
ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
at System.Type.GetType(String typeName)
at System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData)
at System.Diagnostics.TypedElement.BaseGetRuntimeObject()
at System.Diagnostics.ListenerElement.GetRuntimeObject()
at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject()
at System.Diagnostics.TraceInternal.get_Listeners()
at System.Diagnostics.TraceInternal.WriteLine(String message)
at myproject.GameAPI.Login(Int64 fbid, Int64[] friends) in F:\SVNProjects\myproject\GameLogic\GameAPI.cs:line 119
InnerException:
How can this be solved?
Check the web.config / app.config for all your roles. Make sure that you change the version number for any reference to the Microsoft.WindowsAzure.Diagnostics assembly to version 1.7.0.0
All your azure assembly references in your web/worker role projects should point to 1.7.0.0 Versions. Your ccproj files should contain
<ProductVersion>1.7</ProductVersion>
to ensure that the Azure instances contain the proper base assemblies.
You could also check if Microsoft.WindowsAzure.Diagnostics is copied to the output/azure package.
The above didn't work for me (everywhere I looked it said 1.7), instead I went through each project, removed and re added any reference that started with:
Microsoft.WindowsAzure.*
When you re-add them make sure it says version 1.7.