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

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.

Related

VS2022 Installer: Impossible to install/repair because of System.Numerics and/or Newtonsoft.Json.Utilities.ConvertUtils exception

This issue started today (or very recently) with a .NET 4.7.2 project that stopped running on my Win10, VS2022 Enterprise machine complaining about some missing or mismatch version of System.Numerics library. Automatic binding redirect was already enabled.
When I launched VS Installer, nothing showed up (neither installed nor available). However VS2022 was still running ok. The more I tried to fix things, the worse it got. I already wasted hours trying to reinstall, reinstall online, repair, uninstall from add/remove programs, uninstall manually using installcleanup.exe, renaming Installer folder, removing all assemblies from the GAC, etc.
To make it short, the error that shows up during Installer installation is the following:
Unable to acquire update installer
The error in the logs is always the same:
VisualStudio Bootstrapper:15/07/2022 14:09:48: Caught Exception: Type = TypeInitializationException,
Message = The type initializer for 'Newtonsoft.Json.Utilities.ConvertUtils' threw an exception.,
StackTrace = at Newtonsoft.Json.Utilities.ConvertUtils.GetTypeCode(Type t, Boolean& isEnum)
at Newtonsoft.Json.Serialization.DefaultContractResolver.IsJsonPrimitiveType(Type t)
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Microsoft.VisualStudio.Setup.Utility.JsonUtility.ParseNameValuePairJson(String jsonContents)
at Microsoft.VisualStudio.Setup.Utility.JsonUtility.ParseNameValuePairJsonFile(IServiceProvider services, String filePath)
at Microsoft.VisualStudio.Setup.Bootstrapper.Program.Parse(String[] args, IServiceProvider serviceProvider, IC2RSignatureReaderInterop c2rSignatureReader, String entryAssemblyProcessName, String entryAssemblyProcessFullName)
InnerException:Type = FileNotFoundException,
Message = Could not load file or assembly 'System.Numerics, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.,
StackTrace = at Newtonsoft.Json.Utilities.ConvertUtils..cctor()
Note: I already looked up this issue a lot, so please do not suggest obvious widely referenced solutions like "Add/Remove programs" or "Repair button". Also the "Report problem" button on the installer window that I am able to launch by renaming installer folder does not work. Offline installation via command line also does not work.
Has anyone already experienced this issue and can propose a solution other than reinstalling the whole OS? It looks the installer is not able to parse some temp/boostraper.json file because of this exception, but I have no idea how to fix this.
Turns out I did remove a GAC, but that was not the GAC (at least not the only one). Based on another answer and MS forums, deleting every GAC* folder from C:\Windows\assembly\ seems to have done the trick. The "other one" was somewhere in AppData folder.

unable configure SQL Server reporting service 2017

I'm getting a typical error, never faced before.
I'm unable to install, un-install or repair
Setting string variable 'InstallFolder' to value 'C:\Program Files\Microsoft SQL Server Reporting Services'
Setting string variable 'SKU' to value 'SsrsEvaluation'
UnexpectedError: Current security context is not associated with an Active Directory domain or forest.
User: Bundle action completed with errors, please fix the issue then try repair.
UnexpectedError: Burn engine encountered error. PackageId: SSReportingServicesSetup.msi, ErrorType: WindowsInstaller, ErrorCode: -2147483648, Data: , ErrorMessage: Something went wrong, please find details in setup logs.CallStack:
Unhandled Exception: System.Exception: XmlException - at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at Microsoft.BIServer.Setup.MigrateSettingsStep.MigrateMachineKeyFromWebToRsConfig()
at SetupEngine.Install()
at SetupEngine.Execute()
at Microsoft.BIServer.Setup.Setup.Main(String cmdLine)
at Microsoft.BIServer.Setup.Setup.Main(String cmdLine)
, UIHint: 0
User: Error: Microsoft SQL Server Reporting Services: Something went wrong, please find details in setup logs.
UnexpectedError: setup failed for packageId: SSReportingServicesSetup.msi, package: Microsoft SQL Server Reporting Services, errorCode: -2147483648, errorMessage: Something went wrong, please find details in setup logs.
Setup: Repair Completed for package Microsoft SQL Server Reporting Services
Applied execute package: SSReportingServicesSetup.msi, result: 0x0, restart: None
Registering dependency: {21dc2411-ec49-43f5-a195-4dcd848b0f84} on package provider: {7E3B2275-82E0-4969-A38D-544F5C360F12}, package: SSReportingServicesSetup.msi
Setup: Package action completed.
Setup: A restart is required.
Condition 'RebootPending = 1' evaluates to false.
User: Bundle action completed with errors, please fix the issue then try repair.
Migrating machine key from ReportServer C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer\web.config to C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer\rsreportserver.config
Install Step Microsoft.BIServer.Setup.MigrateSettingsStep threw exception. System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at Microsoft.BIServer.Setup.MigrateSettingsStep.MigrateMachineKeyFromWebToRsConfig()
at SetupEngine.Install()
Install Microsoft.BIServer.Setup.MigrateSettingsStep | END
Setup FailedSystem.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at Microsoft.BIServer.Setup.MigrateSettingsStep.MigrateMachineKeyFromWebToRsConfig()
at SetupEngine.Install()
at SetupEngine.Execute()
at Microsoft.BIServer.Setup.Setup.Main(String[] cmdLine)
What could be the issues? anyone faced such issues? how to reslove this? Pl help. Thanks.
Delete this folder:
C:\Program Files\Microsoft SQL Server Reporting Services
I looked everywhere for this solution. Deleting the above folder did the trick, followed by running the repair option from SQLServerReportingServices.exe (run as administrator).

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.

.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.