Unity Di container not working with 64 bit build - wcf

I am using Unity for in WCF service to load component.
I am referring below mention article.
https://msdn.microsoft.com/en-us/library/vstudio/hh323725(v=vs.100).aspx
Service is working fine when i build service in visual studio with build option option any CPU.
As one third party component required 64 bit specific build. So i selected 64 bit build option.
I have downloaded Unity code and build for 64 bit but it is also not working.
I am getting below mention exception.
Could not load file or assembly 'Common.Unity' or one of its dependencies. An attempt was made to load a program with an incorrect format.
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.BadImageFormatException: Could not load file or assembly 'Common.Unity' or one of its dependencies. An attempt was made to load a program with an incorrect format.
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.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Common.Unity' could not be loaded.

As this is not issue of Unity.
It is issue of IISExprees of VS2012 which is support on 32 bit.
Can't get IIS Express 8 beta to run website as 64-bit process
https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3254745-allow-for-iis-express-64-bit-to-run-from-visual-st

Related

ASP.NET Core 3.0 project fails to run under IIS Express: HTTP Error 500.30 - ANCM In-Process Start Failure // ERROR: Unknown command '%LAUNCHER_ARGS%'

I migrated a project from asp.net core 2.2 to 3.0 following the migration guide.
After a couple issues were resolved, starting it with dotnet run worked fine.
However when I try to run/debug with IIS Express, I get the following error:
HTTP Error 500.30 - ANCM In-Process Start Failure
Common solutions to this issue:
The application failed to start
The application started but then stopped
The application started but threw an exception during startup
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028265
The output window for "ASP.NET Core Web Server" in Visual Studio shows the follwing error:
ERROR: Unknown command '%LAUNCHER_ARGS%'
As does an error entry in the windows event viewer
<EventData>
<Data>Application '/LM/W3SVC/2/ROOT' with physical root 'C:\Path\To\Project\' has exited from Program.Main with exit code = '1'. First 30KB characters of captured stdout and stderr logs: ERROR: Unknown command '%LAUNCHER_ARGS%'</Data>
<Data>Process Id: 7092.</Data>
<Data>File Version: 13.0.19258.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: aee5e4080331553ea9dfb7fb388b6d72f715bf6a</Data>
</EventData>
Immediately followed by:
<EventData>
<Data>Application '/LM/W3SVC/2/ROOT' with physical root 'C:\Path\To\Project\' failed to load coreclr. Exception message: CLR worker thread exited prematurely</Data>
<Data>Process Id: 7092.</Data>
<Data>File Version: 13.0.19258.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: aee5e4080331553ea9dfb7fb388b6d72f715bf6a</Data>
</EventData>
My initial thought was that there was an issue with my system setup, but a fresh ASP.NET Core 3.0 project runs without issues in IIS Express. I compared the two applicationhost.config files of the projects and they're identical (except differences like the project name). I also can't find any meaningful differences in the other project files (Project.csproj, appsettings.json, launchSettings.json). I also tried deleting the .vs folder and .user files .
The error messages suggests that it's not a problem with my code. As does the fact that there's no exception the attached debugger breaks at and that everything seems to work fine using dotnet run. Yet a fresh project created via template runs without those issues.
I was able to identify the issue. One mistake I made was to attribute the ERROR: Unknown command message to ASP.NET, when it was actually our application that complained.
The %LAUNCHER_ARGS% parameter is still passed to the application, but it's no longer set in an in-process hosting context.
More details here: https://github.com/aspnet/AspNetCore/issues/14735

TFS 2015 - Waiting for an agent to be requested

So after coming back from vacation my build server don't want to run any builds anymore. It's just stuck on Waiting for an available agent / Waiting for an agent to be requested and if I cancel it I feel it get's stuck on Build Cancelling... since nothing more is happening after I cancel the build. The waiting message is still there but the build is not in the build queue though.
All the agents are green in the Agent Pool and the background service is running.
I am getting the following error in the event log:
Detailed Message: There was an error during job agent execution. The operation will be retried. Similar errors in the next five minutes may not be logged.
Exception Message: A previous call to WebApiConfiguration.Initialize failed. See inner exception for details. (type WebApiInitializationPreviouslyFailedException)
And after 14 Inner Exceptions with the same message on the 15th Inner Exception it says:
Exception Message: Could not load file or assembly 'System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (type FileNotFoundException)
I have installed the standalone installer for MVC 4 from http://www.asp.net/mvc/mvc4 but that did not help. Also think it's wierd that it's suddenly missing this assembly. I have also tried reconfiguring the agent.
Finnaly got this working again \o/
What I think fixed it was installing the ASP.NET MVC Security Update MS14-059 from this site: https://www.microsoft.com/en-us/download/details.aspx?id=44533
It's still no System.Web.Mvc assembly reference in the %windir%\assembly folder but after innstalling the fix and restarting the server the job agent queued the job right away. And I had restarted the server multiple times before that so it was definitely not because of the restart.

Application Insights failing with System.Reflection.TargetInvocationException on load - WP 8.1

I am starting to explore Application Insights and tried adding it to my Windows Phone 8.1 app. While trying to execute the project, an exception is thrown on load within Public Sub New() in App.xaml.vb. The line where the error happens is
TelemetryClient = new TelemetryClient()
The exception thrown is
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.ni.dll
An exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.ni.dll but was not handled in user code
Additional information: Exception has been thrown by the target of an invocation.
Innerexception details:
{System.InvalidOperationException: Type 'Microsoft.ApplicationInsights.Extensibility.ComponentContextInitializer, Microsoft.ApplicationInsights, Version=0.16.1.418, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not implement the required interface
Microsoft.ApplicationInsights.Extensibility.IContextInitializer.
at Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.CreateInstance(Type interfaceType, String typeName)
at Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.LoadInstance(XElement definition, Type expectedType, Object instance)
at Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.LoadInstances[T](XElement definition, ICollection`1 instances)}
I followed the steps outlined in the Azure documentation. What may I be doing wrong?
Are you using a Windows Phone app on top of Windows Runtime or on top of Silverlight?
If you remove the following line from ApplicationInsights.config, does your app start successfully?
<Add Type="Microsoft.ApplicationInsights.Extensibility.ComponentContextInitializer, Microsoft.ApplicationInsights"/>
Turns out it was a corrupted solution. I had added the nuget and then added the Application Insights. In between I had upgraded the nugget package to the 0.16 pre-release version. In effect it had created multiple references. So I ended up manually clearing all entries of Microsoft.ApplicationInsights in package.config and .vbproj. I also removed all the references and referenced the whole thing again. Now it works like a charm!

DotNetNuke Custom Module Development using Chris Hammond's Templates Error

I am working on a custom module for Dot Net Nuke and am currently just setting up my environment. I have it pretty much completed however every time I try to export and use the default templates provided by Chris Hammond I also get an error with the module.
It always comes back with :
"
Error: EmployerPortalManager is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Unable to find the requested .Net Framework Data Provider. It may not be installed. ---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed. at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) at PetaPoco.Database.CommonConstruct() at PetaPoco.Database..ctor(String connectionStringName) at DotNetNuke.Data.DataContext.Instance() at UBA.Modules.EmployerPortalManager.Components.ItemController.GetItems(Int32 moduleId) in c:\websites\vmotest02\DesktopModules\EmployerPortalManager\Components\ItemController.cs:line 46 at UBA.Modules.EmployerPortalManager.View.Page_Load(Object sender, EventArgs e) in c:\websites\vmotest02\DesktopModules\EmployerPortalManager\View.ascx.cs:line 45 --- End of inner exception stack trace ---
"
Any ideas on how to go about solving this problem? I am using DNN 07.02.02 (303) and VS 2012 with the 2.5 templates in C#.
Any help is appreciated.

Subsonic T4 TextTemplatingService Exception on VS 2005

I have a VS2005 web application I am using the MySQL active record templates and is perfectly working in VS2008 however I get this error:
Custom tool error: An Exception was thrown while running the transformation code. The process cannot continue. The following Exception was thrown:
System.Runtime.Serialization.SerializationException: Type 'Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService' in Assembly 'Microsoft.VisualStudio.TextTemplating.VSHost, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.
View Full Exception Details:
http://pastebin.com/rF8iQJW2
I have the following packages installed to make it work for vs2005:
http://goo.gl/uINkV
Guidance Automation Toolkit for Visual Studio 2005 - February 2008 Release
http://goo.gl/OEUNP
Guidance Automation Extensions - February 2008 Release
Subsonic 3.0 doesn't work for VS2005 as it requires .NET framework 3.5
Previous answer is not correct. The T4 system now runs out of process and sets up an Ipc channel back to the Host. This transport channel ( based on remoting ) uses a Binary serializer and cannot transport the Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService over that channel because it is not marked as serializable, exactly as the exception message says.
Incidently, you can get access to this service by changing the template directive hostspecific="true" and accessing the "Host" property.
There are also some parts of the EnvDTE.DTE that cannot be accessed via T4 templates for the same reason ( like DTE.Windows or DTE.WindowConfiguration ).