I have a code which works fine with 1.6.6 version. For example this line:
var root = new AstRootNode(null);
I decided to update the library to 1.7.0.0 and now I get "The type initializer for '<>z__Aspects' threw an exception.". If someone else faced this problem, please help solve it.
Inner Exception:
{"Could not load file or assembly 'Utility, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"Utility, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"}
Stack Trace:
at Varigence.Utility.ComponentModel.VulcanNotifyPropertyChanged..ctor()
at Varigence.Languages.Biml.AstNode..ctor(IFrameworkItem parentItem)
at Varigence.Languages.Biml.AstRootNode..ctor(IFrameworkItem parentItem)
at ConsoleApplication1.Program.Main(String[] args) in c:\Users\Nikolai\Documents\Visual Studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 14
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Related
I'm unable to connect to Team Foundation Server 2010 (TFS) from a simple C# Console Application.
My Console Application has .Net Framework 4.5 as Target Framework and is opened into VS2015.
In the project I referenced the TFS API with Nuget, in the pic below you can see the assemblies.
And this is the simple code
using Microsoft.TeamFoundation.Client;
using System;
using System.Configuration;
using System.Data;
using System.IO;
namespace FindWorkItemChangesetDetails
{
public class Program
{
static void Main(string[] args)
{
string TfsServer = "http://xx.xxx.xxx.xx:8080/tfs";
////Initialize TFS Server object
TfsConfigurationServer configurationServer =
TfsConfigurationServerFactory.GetConfigurationServer(new Uri(TfsServer));
}
}
The exception returned is:
System.IO.FileNotFoundException was unhandled
FileName=Microsoft.VisualStudio.Services.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
FusionLog==== Informazioni sullo stato di preassociazione ===
REG: DisplayName = Microsoft.VisualStudio.Services.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
REG: Appbase = file:///C:/Sviluppo/Tool/FindWorkItemChangesetDetails/bin/Debug/
REG: PrivatePath iniziale = NULL
Assembly chiamante: Microsoft.TeamFoundation.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
REG: l'associazione ha origine nel contesto di caricamento di default.
REG: utilizzo del file di configurazione dell'applicazione: C:\Sviluppo\Tool\FindWorkItemChangesetDetails\bin\Debug\FindWorItemChangesetDetails.vshost.exe.config
REG: utilizzo del file di configurazione host:
REG: utilizzo del file di configurazione computer da C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
REG: riferimento post-criteri: Microsoft.VisualStudio.Services.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
REG: tentativo di download del nuovo URL file:///C:/Sviluppo/Tool/FindWorkItemChangesetDetails/bin/Debug/Microsoft.VisualStudio.Services.Common.DLL.
REG: tentativo di download del nuovo URL file:///C:/Sviluppo/Tool/FindWorkItemChangesetDetails/bin/Debug/Microsoft.VisualStudio.Services.Common/Microsoft.VisualStudio.Services.Common.DLL.
REG: tentativo di download del nuovo URL file:///C:/Sviluppo/Tool/FindWorkItemChangesetDetails/bin/Debug/Microsoft.VisualStudio.Services.Common.EXE.
REG: tentativo di download del nuovo URL file:///C:/Sviluppo/Tool/FindWorkItemChangesetDetails/bin/Debug/Microsoft.VisualStudio.Services.Common/Microsoft.VisualStudio.Services.Common.EXE.
HResult=-2147024894
Message=Impossibile caricare il file o l'assembly 'Microsoft.VisualStudio.Services.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' o una delle relative dipendenze. Impossibile trovare il file specificato.
Source=Microsoft.TeamFoundation.Client
StackTrace:
in Microsoft.TeamFoundation.Client.TfsClientCredentials.LoadCachedCredentials(String featureRegistryKeyword, Uri serverUrl, Boolean requireExactMatch, Boolean allowInteractive, String registryRootPath, Boolean useWOW6432Hive)
in Microsoft.TeamFoundation.Client.TfsClientCredentialsCache.GetCredentials(String featureRegistryKeyword, Uri uri)
in Microsoft.TeamFoundation.Client.TfsConfigurationServerFactory.GetConfigurationServer(Uri uri)
in FindWorkItemChangesetDetails.Program.Main(String[] args) in C:\Sviluppo\Tool\FindWorkItemChangesetDetails\Program.cs:riga 16
in System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
in System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ThreadHelper.ThreadStart()
InnerException:
After I referenced the Microsoft.Visual Studio.Services.Common I got this error
System.TypeLoadException was unhandled
HResult=-2146233054
Message=Impossibile caricare il tipo 'Microsoft.TeamFoundation.Common.Internal.RegistryAccessMask' dall'assembly 'Microsoft.TeamFoundation.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Source=Microsoft.TeamFoundation.Client
TypeName=Microsoft.TeamFoundation.Common.Internal.RegistryAccessMask
StackTrace:
in Microsoft.TeamFoundation.Client.CredentialsCacheManager..ctor()
in Microsoft.TeamFoundation.Client.TfsClientCredentials.LoadCachedCredentials(String featureRegistryKeyword, Uri serverUrl, Boolean requireExactMatch, Boolean allowInteractive, String registryRootPath, Boolean useWOW6432Hive)
in Microsoft.TeamFoundation.Client.TfsClientCredentialsCache.GetCredentials(String featureRegistryKeyword, Uri uri)
in Microsoft.TeamFoundation.Client.TfsConfigurationServerFactory.GetConfigurationServer(Uri uri)
in FindWorkItemChangesetDetails.Program.Main(String[] args) in C:\Sviluppo\Tool\FindWorkItemChangesetDetails\Program.cs:riga 16
in System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
in System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ThreadHelper.ThreadStart()
InnerException:
Any idea to fix the problem?
Thank you
Luca
In VS2015, you can find the dlls in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer, try to add the dlls from the path.
when i try to implement a consumer like the example mentionened in readme section the following
line
var config = new Config() { GroupId = "example-csharp-consumer" };
causes this exception
System.TypeInitializationException was unhandled
HResult=-2146233036
Message=Der Typeninitialisierer für "RdKafka.Internal.LibRdKafka" hat eine Ausnahme verursacht.
Source=RdKafka
TypeName=RdKafka.Internal.LibRdKafka
StackTrace:
bei RdKafka.Internal.LibRdKafka.conf_new()
bei RdKafka.Internal.SafeConfigHandle.Create()
bei RdKafka.Config..ctor()
bei kafka_consumer_example.Program.Main(String[] args) in C:\Users\stc\Development\git\kafka-consumer-example\Program.cs:Zeile 18.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException:
HResult=-2146233052
Message=Die DLL "librdkafka": Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E) kann nicht geladen werden.
Source=RdKafka
TypeName=""
StackTrace:
bei RdKafka.Internal.LibRdKafka.NativeMethods.rd_kafka_version()
bei RdKafka.Internal.LibRdKafka.version()
bei RdKafka.Internal.LibRdKafka..cctor()
InnerException:
the stacktrace looks like
in RdKafka.Internal.LibRdKafka.NativeMethods.rd_kafka_version()
in RdKafka.Internal.LibRdKafka.version()
in RdKafka.Internal.LibRdKafka..cctor()
i integrated the library via Nuget from https://www.nuget.org/packages/RdKafka/0.9.1-ci-131
can anyone tell me which assemblie i'm missing ?
You need install Visual C++ Redistributable Packages for Visual Studio 2013
https://www.microsoft.com/en-US/download/details.aspx?id=40784
I am trying to create a eventhandler for a msmq message router and I almost just copied a online example from msdn library
example 2.
But when I invoke messageQueue.BeginReceive() I get a IllegalFormatName exception.
I am using a private queue
Using VS 2015 on windows 10
Solution is using .Net 4.5.2
I got no problems sending messages to any of my private queues or reading from them if I use messageQueue.Receive()
Exception details below:
System.Messaging.MessageQueueException was unhandled
ErrorCode=-2147467259 HResult=-2147467259 Message=Formatnavnet er
ugyldigt. Source=System.Messaging StackTrace:
ved System.Messaging.MessageQueue.MQCacheableInfo.get_ReadHandle()
ved System.Messaging.MessageQueue.ReceiveAsync(TimeSpan timeout, CursorHandle cursorHandle, Int32 action, AsyncCallback
callback, Object stateObject)
ved System.Messaging.MessageQueue.BeginReceive()
ved MYFirstMSMQ.Program.Main(String[] args) in ......Visual Studio 2015\Projects\FirstQueue_bluff_city\ConsoleApplication1\Program.cs:linje
68
ved System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
ved System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
ved Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
ved System.Threading.ThreadHelper.ThreadStart_Context(Object state)
ved System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
ved System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
ved System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
ved System.Threading.ThreadHelper.ThreadStart() InnerException:
Sorry about the Message - windows returns some messages in my native language
My c# program uses Matlab dll and it works find as long as I run it in Debug mode.
but as I trying to run it in Release mode it crashes immediately when creating it's instance.
It trows TypeInitializationException.
Thanks for your help
StackTrace:
"at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at Turbo_Neuron.ANNController..ctor()
in C:\\Users\\Eli\\Desktop\\....\\MyProject\\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()"
And it sais:
The type initializer for 'MatlabANNComp.MatlabANN' threw an exception.
StachTrace 2:
at MatlabANNComp.MatlabANN..ctor()
at Turbo_Neuron.ANNController..ctor() in C:\Users\Eli\Desktop\Work_ANN\ANN\working\Current\Turbo_Neuron_Pro_Filxed_10.09.13_N\Turbo_Neuron\Matlab_Layer\ANNController.cs:line 49
at Turbo_Neuron.TNController..ctor(pnl_main form) in C:\Users\Eli\Desktop\Work_ANN\ANN\working\Current\Turbo_Neuron_Pro_Filxed_10.09.13_N\Turbo_Neuron\Logic_Layer\TNController.cs:line 49
at Turbo_Neuron.pnl_main..ctor() in C:\Users\Eli\Desktop\Work_ANN\ANN\working\Current\Turbo_Neuron_Pro_Filxed_10.09.13_N\Turbo_Neuron\View_Layer\Turbo_Form.cs:line 29
at Turbo_Neuron.Program.Main() in C:\Users\Eli\Desktop\Work_ANN\ANN\working\Current\Turbo_Neuron_Pro_Filxed_10.09.13_N\Turbo_Neuron\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Exception messages:
Exception.Message =
"The type initializer for 'MatlabANNComp.MatlabANN' threw an exception."
InnerException.Message =
{"Could not load file or assembly 'MWArray, Version=2.10.1.0,
Culture=neutral, PublicKeyToken=e1d84a0da19db86f'
or one of its dependencies. An attempt was made
to load a program with an incorrect format."}
InnerException.InnerException = null
An attempt was made to load a program with an incorrect format
this is the key, and it means you are mixing platforms somwhow. A 32bit process cannot load 64bit dlls and vice-versa. If a process tries to do so anyway, it throws the above exception.
You say you only changed from Debug->Release, so it's likely something that has to do with platform changed as well. Compare settings for all projects in the Configuration Manager. They all should be x86 or x64 (not AnyCPU). Which one depends on your matlab dll's platform (set when building it).
I realise that this question has been asked and solved many times before here and that there are many helpful posts such as this one...http://blogs.teamb.com/craigstuntz/2010/08/13/38628/
But unfortunately none of the suggestions have worked for me, so I'm posting in the hope that someone might spot something I haven't seen.
I have a database project Sp_CodeGenerator - I've connected to the database. My connection string is
<add name="AdWorksLTEntities" connectionString="metadata=res://*/Sp_CodeGenerator.Model1.csdl|res://*/Sp_CodeGenerator.Model1.ssdl|res://*/Sp_CodeGenerator.Model1.msl;provider=System.Data.SqlClient;provider connection string="Data Source=EIRCOM;Initial Catalog=AdventureWorksLT2008R2;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework"" providerName="System.Data.EntityClient"/>
I have tried substituting //*/Sp_CodeGenerator.Model... with the name of the dll //Sp_CodeGenerator/Sp_CodeGenerator.Model.csdl etc But it doesn't work.
I have also removed all references in the .config file, removed the .edmx file and the template files generated by Entity Frameworks and started over many times, but it doesn't work.
I can see in my directory structure that the edmx files :Model1.csdl, Model1.msl, Model1.ssdl are housed in a folder called edmxResourcesToEmbed and they can be found in C:\Sp_CodeGenerator\Sp_CodeGenerator\obj\x86
So the full path is
C:\Sp_CodeGenerator\Sp_CodeGenerator\obj\x86\Debug\edmxResourcesToEmbed
I'm not sure if it is a coincidence, but once the problem appeared I also noticed that I have several messages once I open the .config file about missing schemas for element 'entityFramework' 'defaultconnectionFactory' 'type' etc etc.
Any suggestions of where to look next, greatly appreciated.
The full stack trace on the MetadataException is
at System.Data.Metadata.Edm.MetadataArtifactLoaderResource.LoadResource()
at System.Data.Metadata.Edm.MetadataArtifactLoaderResource.CreateReader()
at System.Data.Metadata.Edm.MetadataArtifactLoaderResource.CreateReaders(DataSpace spaceToGet)
at System.Data.Metadata.Edm.MetadataArtifactLoaderComposite.CreateReaders(DataSpace spaceToGet)
at System.Data.Metadata.Edm.MetadataCache.EdmMetadataEntry.LoadEdmItemCollection(MetadataArtifactLoader loader)
at System.Data.Metadata.Edm.MetadataCache.EdmItemCollectionLoader.LoadItemCollection(EdmMetadataEntry entry)
at System.Data.Metadata.Edm.MetadataCache.LoadItemCollection[T](IItemCollectionLoader`1 itemCollectionLoader, T entry)
at System.Data.Metadata.Edm.MetadataCache.GetOrCreateEdmItemCollection(String cacheKey, MetadataArtifactLoader loader, Object& entryToken)
at System.Data.EntityClient.EntityConnection.LoadEdmItemCollection(MetadataWorkspace workspace, MetadataArtifactLoader artifactLoader)
at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections)
at System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection()
at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor)
at System.Data.Objects.ObjectContext..ctor(EntityConnection connection)
at System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel()
at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.OrderBy[TSource,TKey](IQueryable`1 source, Expression`1 keySelector)
at Sp_CodeGenerator.SelectAll.SelectAll_Method() in C:\Sp_CodeGenerator\Sp_CodeGenerator\Templates\dbo.SelectAll.StoredProcedure.sql.xml.cs:line 14
at Sp_CodeGenerator.Program.Main(String[] args) in C:\Sp_CodeGenerator\Sp_CodeGenerator\Program.cs:line 15
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
I found the solution - I just needed to remove the Sp_CodeGenerator. from infront each Model1 in the connection string. Not really sure why the connection string was generated like that in the first place? Maybe something to do with my directory structure?