Missing Browserlink in VS2019, Where is browserlink acquired / loaded from normally? - c#

My local install of VS2019 (16) seems to be missing references to BrowserLink. I've tried repairing the installation, and installing multiple different SDK's to no avail.
Where is BrowserLink normally located? And what is the mechanism that causes it to be loaded in development versions? It doesn't seem to be packaged seperately from VS since version 12, unless you are using the new .net core versions.
We have checked the GAC, NuGET, and are running out of options.
It's a .net 4.5 project, if that's relevent.
Could not locate assembly Microsoft.WebTools.BrowserLink.Runtime, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a in the Assembly Stores configured. Requesting assembly:
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.Exception: Could not locate assembly Microsoft.WebTools.BrowserLink.Runtime, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a in the Assembly Stores configured. Requesting assembly:
The root cause is almost certainly something to do with the dumb way this project has a shared non-standard assembly cache, and doesn't fallback to normal dev locations, but the question is about what the normal location/mechanism is for BrowserLink (16) to be loaded.

If you have installed your VS2019 in default options, you can find the Browser Link library files in this path:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions\Microsoft\Web Tools\Browser Link
(Replace the path of your installation location as appropriate)
You can then decide whether to copy Microsoft.WebTools.BrowserLink.*.dll to the assembly cache of your application or include this path in your application.

Related

Could not load file or assembly 'Microsoft.AspNetCore.Http.Extensions, Version=3.1.0.0 in windows 10 machine

I am trying to run my Dotnet-Core web Api project in windows 10 machine. But I am facing runtime error. I 'm not allowed to change the Application nuget version too
>fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HMLLR56JLU26", Request id "0HMLLR56JLU26:0000000B": An unhandled exception was thrown by the application.
System.BadImageFormatException: Could not load file or assembly 'Microsoft.AspNetCore.Http.Extensions, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. Format of the executable (.exe) or library (.dll) is invalid.
File name: 'Microsoft.AspNetCore.Http.Extensions, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Microsoft.AspNetCore.StaticFiles.StaticFileContext.get_RequestHeaders
at Microsoft.AspNetCore.StaticFiles.StaticFileContext.ComputeIfMatch()
at Microsoft.AspNetCore.StaticFiles.StaticFileContext.ComprehendRequestHeaders()
at Microsoft.AspNetCore.StaticFiles.StaticFileContext.ServeStaticFile(HttpContext context, RequestDelegate next)
The answer here lies in - BadImageFormatException. One of these
Your app is compiled for one architecture (x64 or x86) but your Web Server pool runs different one
One of the 3rd party DLLs is of incompatible architecture (your case)
One of your DLLs is of incompatible architecture.
DLL is compiled for the wrong platform. e.g. running DLL compiled for .net4.8 in the .netcore (your case)

NanoFramework Device Explorer would not open

I was able to use nanoframework normally but somehow the DeviceExplorer no longer opens now.
I checked the ActivityLog.xml and it shows the following error:
819 ERROR SetSite failed for package [Visual Studio 2019 extension for nanoFramework. Enables creating C# Solutions to be deployed to a target board and provides debugging tools.]Source: 'nanoFramework.Tools.VS2019.Extension' Description: Could not load file or assembly 'Microsoft.VisualStudio.Threading, Version=16.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Threading, Version=16.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.VisualStudio.Threading, Version=16.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'at nanoFramework.Tools.VisualStudio.Extension.NanoFrameworkPackage.<InitializeAsync>d__65.MoveNext()at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)at nanoFramework.Tools.VisualStudio.Extension.NanoFrameworkPackage.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress)at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass20_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)at Microsoft.VisualStudio.Services.VsTask.GetResult() WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. {046B40EB-1DE1-4D08-AF61-FDB7592B9BBD} 80070002 VisualStudio 2021/03/21 07:18:45.265
820 ERROR End package load [Visual Studio 2019 extension for nanoFramework. Enables creating C# Solutions to be deployed to a target board and provides debugging tools.] {046B40EB-1DE1-4D08-AF61-FDB7592B9BBD} 80070002 VisualStudio 2021/03/21 07:18:45.270
I want to highlight that my Visual Studio nanoframework extension is set to update automatically and it sounds like it recently got updated to 2019.5.0.34
I am using Visual Studio Profession 2019 16.8.3
Disabling/Enabling the extension, restarting the visual studio did not help.
Any clue what could be causing this issue?
You should update Visual Studio to 16.9 or higher.

Code running fine locally but erroring when published live on GoDaddy

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please review the
specific error details below and modify your configuration file
appropriately.
Parser Error Message: Could not load file or assembly 'MySql.Data,
Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or
one of its dependencies. The system cannot find the file specified.
Source Error:
An application error occurred on the server. The current custom error
settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could,
however, be viewed by browsers running on the local server machine.
Source File: G:\PleskVhosts\dekhoroom.com\httpdocs\web.config Line:
11
Assembly Load Trace: The following information can be helpful to
determine why the assembly 'MySql.Data, Version=6.4.4.0,
Culture=neutral, PublicKeyToken=c5687fc88969c44d' could not be loaded.
WRN: Assembly binding logging is turned OFF. To enable assembly bind
failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There
is some performance penalty associated with assembly bind failure
logging. To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
If you, on your local development machine, have MySql.Data in your GAC, it will not be in your Web app's bin directory. And if it is that bin directory that gets deployed, Sql.Data will not be there. Do not expect a hosting provider to have all kinds of assemblies in the GAC.
So the solution is to deploy all the assemblies your Web app needs. Deploy MySql.Data, and any other assemblies that it depends upon, along with your Web application.
For the same reason, it is a good idea not to install ASP.NET MVC in your GAC but to simply reference it and deploy it along with your Web application.

How to execute with a copied dll from another machine - c#

I am trying to provide a colleague with a dll that is from my build so she can execute with the changes i have made. Unfortunately she gets the following error
The system was unable to launch the requested screen. --->
Unable to display screen.
---> System.IO.FileLoadException: Could not load file or assembly 'file:///name.dll' or one of its dependencies. Operation is not
supported. (Exception from HRESULT: 0x80131515) --->
System.NotSupportedException: An attempt was made to load an assembly
from a network location which would have caused the assembly to be
sandboxed in previous versions of the .NET Framework. This release of
the .NET Framework does not enable CAS policy by default, so this load
may be dangerous. If this load is not intended to sandbox the
assembly, please enable the loadFromRemoteSources switch
Now if she were trying to run it in visual studio i could set the loadFromRemoteSources switch - however this dll is replacing a dll in an install version on a vagrant box. How can i enable the dll to run in this scenario?
Thanks

Could not load file or assembly System, Version=2.0.5.0 in .NET 4 MVC 4 application

Been searching for ages, can't find anything helpful. Here is the exception I'm getting:
Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Stack Trace:
[FileLoadException: Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)]
StructureMap.Graph.PluginGraph..ctor() in c:\BuildAgent\work\996e173a8ceccdca\src\StructureMap\Graph\PluginGraph.cs:41
StructureMap.PluginGraphBuilder..ctor() in c:\BuildAgent\work\996e173a8ceccdca\src\StructureMap\PluginGraphBuilder.cs:22
StructureMap.InitializationExpression..ctor() in c:\BuildAgent\work\996e173a8ceccdca\src\StructureMap\InitializationExpression.cs:22
StructureMap.ObjectFactory.Initialize(Action`1 action) in c:\BuildAgent\work\996e173a8ceccdca\src\StructureMap\ObjectFactory.cs:47
...
This applications works fine on the test server but is throwing this exception on the production server. As you can see, the StructureMap code is what is causing the exception.
I had to convert this app to .NET 4 from 4.5 because 4.5 wasn't installed on the production server. After the conversion, the app still works fine on my local machine and the test server.
I have already set the Copy Local to True for the System assembly, but since the referenced version is 4.0.0.0 and not 2.0.5.0, I this made no difference.
Let me know if any more info is needed. Any help you may be able to provide is appreciated.
Make sure your .NET framework is patched. Microsoft released patches to .NET to allow Portable Class Libraries to properly find the appropriate runtime (KB2468871). If you are seeing the above exception (or something like it), it means you're missing the latest .NET framework patches.
Edit the web.config file to remove the reference, which is not required for normal operation:
1 - Open the web.config file in the root of your site
2 - Find the following line and comment it out():xxxxx-is your assembly name.
<add assembly="xxxxx", Version=2.0.5.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
3 - Save and close the web.config file and try again
I found that it was the "await" and "async" that where giving me trouble.
I had Windows XP SP3 with only .NET 4.0, but had to update it to .NET 4.0.3 using KB2600211 - this wasn't updated automatically through Windows Update when .NET 4.0.3 came out because the computer is off-grid.
This is the link to the update:
https://www.microsoft.com/en-us/download/details.aspx?id=29053
I just want to share another solution from here that solved the problem on my development machine: installing Silverlight 5 SDK (only 11.2MB at the time of writing this post) was enough to make everything working.
Install Microsoft® Silverlight® 5 SDK from the following link. It resolves and works fine for me.
SDK download
Starting from a machine configuration that only had VS2017 and Silverlight 5 SDK on it, I installed VS2015 on top of that. This is when I started getting the System.Core and System.Windows problems.
When I uninstalled VS2015 and re-installed Silverlight 5 SDK, these problems went away.

Categories

Resources