With the latest visual studio 2022 17.3.0 update, my xamarin native app can't be started in debug as I keep getting this message:
Forwarding debugger port 8811
Detecting existing process
I have tried to clean and unistall app from the phone.
Same project works fine on visual studio 2019.
Thanks
Just activate Use Fast Deployment, i was having the same issue, but i activated this option, and now works!!!
I am also experiencing this. Multiple devices. I can use Visual Studio 2019 and it works fine. It was working with Visual Studio 2022 until the last update. Tried cleaning solution, manually deleting obj directories, manually uninstalling from device, etc.
Main errors I get are...
[monodroid] Creating public update directory: /data/user/0/com.lathem.payclock/files/.__override__
[art] Attempt to remove non-JNI local reference, dumping thread
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8864,server=y,embedding=1
[monodroid-assembly] Failed to load managed assembly 'mscorlib.dll'. Internal error
[monodroid-assembly] open_from_bundles: failed to load assembly mscorlib.dll
[mono] The assembly mscorlib.dll was not found or could not be loaded.
[mono] It should have been installed in the `/Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/sdks/out/android-armeabi-v7a-release/lib/mono/2.1/mscorlib.dll' directory.
And this...
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(String format, Object[] args)
at Mono.AndroidTools.AndroidLogger.LogError(String task, String format, Object[] args) in D:\a_work\1\s\External\androidtools\Mono.AndroidTools\AndroidLogger.cs:line 63
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass118_0.b__0() in D:\a_work\1\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 1012
Related
Since a couple of weeks I suddenly have issues with the SpecFlow extension in Visual Studio 2019 (professional edition). Out of the blue it stopped working. First I thought because of an update of VS, but other colleagues of mine are using the same (latest) version of VS and for them SpecFlow works.
The problems I'm experiencing are:
No settings menu for SpecFlow (Tools - Options - SpecFlow)
A NullReferenceException when opening a feature file (see end of post for entry of activity log)
When feature file is opened no syntax highlighting
No context menu
The test explorer is still discovering the tests and I can still run them, but not from the feature file (neither debugging the steps).
The extension is installed and enabled correctly (as far as I can tell).
Already tried the following without success:
Uninstall and install the SpecFlow for Visual Studio 2019 extension
Uninstall SpecFlow and install Deveroom
Uninstall Visual Studio 2019 and install again
Any of you have any idea on what might be causing this?
Activity log entry
<entry>
<record>806</record>
<time>2021/02/09 09:25:56.786</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.NullReferenceException: Object reference not set to an instance of an object.
at TechTalk.SpecFlow.VsIntegration.LanguageService.ProjectScopeFactory.<.ctor>b__9_0() in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\ProjectScopeFactory.cs:line 52
at TechTalk.SpecFlow.VsIntegration.Implementation.Utils.SynchInitializedInstance`1.EnsureInitialized()
at TechTalk.SpecFlow.VsIntegration.LanguageService.ProjectScopeFactory.<.ctor>b__9_2(Project project) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\ProjectScopeFactory.cs:line 64
at TechTalk.SpecFlow.VsIntegration.Implementation.Utils.SynchronizedResultCache`3.GetOrCreate(TSource source)
at TechTalk.SpecFlow.VsIntegration.LanguageService.ProjectScopeFactory.GetProjectScope(Project project) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\ProjectScopeFactory.cs:line 76
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinLanguageServiceFactory.CreateLanguageService(ITextBuffer textBuffer) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinLanguageServiceFactory.cs:line 51
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinLanguageServiceFactory.<>c__DisplayClass7_0.<GetLanguageService>b__0() in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinLanguageServiceFactory.cs:line 43
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinBufferServiceManager.<>c__DisplayClass3_0`1.<GetOrCreate>b__0() in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinBufferServiceManager.cs:line 32
at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func`1 creator)
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinBufferServiceManager.GetOrCreate[TService](ITextBuffer textBuffer, Func`1 creator) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinBufferServiceManager.cs:line 29
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinLanguageServiceFactory.GetLanguageService(ITextBuffer textBuffer) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinLanguageServiceFactory.cs:line 43
at TechTalk.SpecFlow.VsIntegration.GherkinFileEditor.GherkinFileClassifierProvider.<>c__DisplayClass3_0.<GetClassifier>b__0() in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\GherkinFileEditor\GherkinFileClassifierProvider.cs:line 31
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinBufferServiceManager.<>c__DisplayClass3_0`1.<GetOrCreate>b__0() in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinBufferServiceManager.cs:line 32
at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func`1 creator)
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinBufferServiceManager.GetOrCreate[TService](ITextBuffer textBuffer, Func`1 creator) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinBufferServiceManager.cs:line 29
at TechTalk.SpecFlow.VsIntegration.GherkinFileEditor.GherkinFileClassifierProvider.GetClassifier(ITextBuffer buffer) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\GherkinFileEditor\GherkinFileClassifierProvider.cs:line 30
at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTaggerProvider.<>c__DisplayClass12_0`1.<CreateTagger>b__0(IClassifierProvider provider)
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InvokeEligibleFactories[TExtensionInstance,TExtensionFactory,TMetadataView](IEnumerable`1 lazyFactories, Func`2 getter, IContentType dataContentType, IContentTypeRegistryService contentTypeRegistryService, Object errorSource)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
</description>
</entry>
Edited:
After running a repair of VS I could see the menu option for the 'Clear MEF Component Cache' extension. Unfortunately using this got me no further with the SpecFlow extension (still the same issues).
This looks like the MEF cache of Visual Studio has a problem.
An easy way to clean it is the Clear MEF Component Cache extension from Mads Kristensen. It can be found on the marketplace here: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ClearMEFComponentCache
Install it and after a restart of VS, execute the command in the menu:
After that, restart VS again and the SpecFlow VS Extension should work again.
Due to different issues I received a complete new image on my laptop from the IT department. Due to this the issues with SpecFlow are also resolved. I still don't know exactly what has caused this, but my guess would go to a slightly corrupted registry or something similar.
Anyway no need to answer this anymore.
I took the latest version of Microsoft.Web.WebView2 (0.9.515-prerelease) and added to a test C# WinForms application. Am using VS 2019, .NET framework is 4.7.2.
Placed the WebView2 control on a form, compiled and ran. The application crashed on Load, at the below point in Form1.designer.cs.
// webView21
//
this.webView21.Location = new System.Drawing.Point(153, 66);
this.webView21.Name = "webView21";
this.webView21.Size = new System.Drawing.Size(492, 253);
this.webView21.Source = new System.Uri("about:blank", System.UriKind.Absolute);
this.webView21.TabIndex = 0;
this.webView21.Text = "webView21";
this.webView21.ZoomFactor = 1D;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.webView21); //CRASHED HERE WITH BELOW EXCEPTION -
When I run this in Release mode, get the following exception trace -
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Web.WebView2.WinForms.WebView2.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.OnParentVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Form.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
If I take the latest stable version of WebView2 (v 0.9.488), it throws a compilation error as it does not reflect Microsoft.Web
Please let me know how to fix this error. Appreciate your help very much. Came across this question 8 months ago but am hoping Microsoft has gone beyond that now.
How can I use the Microsoft Edge WebView2 control in C# windows application
The Sample solution Microsoft created does have C# version as well for WinForms.
https://github.com/MicrosoftEdge/WebView2Samples
Tried this sample given by Microsoft as well. It too crashes.
https://learn.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/winforms
you need to make sure 1) the Edge version is right. try download Canary version Edge from Url https://c2rsetup.officeapps.live.com/c2r/downloadEdge.aspx?ProductreleaseID=Edge&platform=Default&version=Edge&source=EdgeInsiderPage&Channel=Canary&language=en
and 2) set x86 as the target platform will fix the problem.
I faced the same issue but I was able to solve it. It crashes any time the traget CPU is "Any CPU" but if you change it to either "x86" or "x64", it runs successfully in my case. Seems it is not able to check and work with unspecified target CPU architecture.
I hope this saves someone lots of headaches
Unfortunately, this is still an issue in 0.9.515-prerelease. There's a bug opened against this and I added some more details about my repro:
https://github.com/MicrosoftEdge/WebViewFeedback/issues/228#issuecomment-687873636
Edit: The x86 suggestion does not apply for you if you install Edge for x64 bits. You can build it for x64 and it will work. More details in my response in the issue: https://github.com/MicrosoftEdge/WebViewFeedback/issues/228#issuecomment-687900181
Following the set platform guidance...
If you are using Canary Microsoft.Web.WebView2.0.9.628-prerelease. There is a known issue, the current solution is to downgrade to Microsoft.Web.WebView2.0.9.579-prerelease.
https://github.com/MicrosoftEdge/WebView2Feedback/issues/431
This worked for me.
from the path of my Edge, "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe", we may conclude the current Edge is 32bit program? wat about give a try setting platform target to x86. some guru said, with x86 set, it will work!
from the MS sample project WebView2WindowsFormsBrowser.csproj, the Microsoft.Web.WebView2 version should be "0.9.515-prerelease".
As stated by others, the minimum Microsoft Edge version is 84.0.515.0 when using WebView2 0.9.515-prerelease. You can download the required Microsoft Edge version from the Microsoft Edge Insider Channel. See the link below.
Here are some useful links when using WebView2:
Microsoft Edge Insider Channels: https://www.microsoftedgeinsider.com/en-us/download
WebView2 Release Notes: https://learn.microsoft.com/en-us/microsoft-edge/webview2/releasenotes
WebView2 Bug Reporting/Feedback (click on "Issues"): https://github.com/MicrosoftEdge/WebViewFeedback
The WebView2 component may generate an exception and crash the application during loading if it does not have permission to create the data folder needed to store user settings, etc.
If the application loads correctly when launched from Visual Studio or from other unrestricted locations, but fails to load when installed into Program Files, then this is a possible issue.
By default, the data folder is created in the same folder as the application exe, which can fail in Program Files. The data folders needs to be set to an alternative location.
This link provides some info on the use of data folders:
Managing the User Data Folder
This issue provides some code for setting the data folder for WebView2 to a valid location:
WebView2 C# Winforms application doesn't work when installed in Program Files folder #297
This worked for me:
var userDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\OurSoftware";
var env = await CoreWebView2Environment.CreateAsync(null, userDataFolder);
I encounter this problem today. My app works flawlessly until today. Turned out Edge Canary has automatically updated, and my WebView2 library (ver. 1.0.11xx) in app become deprecated.
I use Nuget Package Manager. So I open Nuget Package Manager menu, Package Manager Console. Type in
Update-Package
After update, my WebView2 library updated to 1.0.13xx version. My app continues to work again.
I am getting this Kind of Error like::
Specified argument was out of the range of valid values.Parameter name: site
while Debugging any of my Project.
I have also tried after Reinstalling My Visual Studio 2012. But again the same kind of problem I am getting while Debugging.
My System's Configurations are :
Windows 8 : 32-bit
Visual Studio : 2012
Exception is thrown at the time of Showing Web Page Like,
[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: site]
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +298
[HttpException (0x80004005): Specified argument was out of the range of valid values.
Parameter name: site]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
If using IIS:
control panel
Programs
open or close windows features
tick internet information services
then restart your visual studio
If using IIS Express:
Open 'Add/Remove Programs' from the old control panel and run a repair on IIS Express
Or you might go Control Panel ->> Programs ->> Programs and Features ->> Turn Windows features on or off ->> Internet Information Services
and check the checkbox as shown in the picture below:
This occurred to me when I applied the 2017 Fall Creator Update. I was able to resolve by repairing IIS 10.0 Express (I do not have IIS installed on my box.)
Note: As a user pointed out in the comments,
Repair can be found in "Programs and Features" - the "classic" control panel.
I had the same issue i resolved it by repairing the iis server in programs and features.
GO TO
Controll panel > uninstall a program
and then right click the installed iis express server (installed with Visual Studio)
and then click repair.
this is how i solved this issue
I had the same issue with VS2017. Following solved the issue.
Run Command prompt as Administrator.
Write following two commands which will update your registry.
reg add HKLM\Software\WOW6432Node\Microsoft\InetStp /v MajorVersion /t
REG_DWORD /d 10 /f
reg add HKLM\Software\Microsoft\InetStp /v MajorVersion /t REG_DWORD
/d 10 /f
This should solve your problem. Refer to this link for more details.
Instead of installing the bloated IIS, I get mine resolved by installing Internet Information Services Hostable Web Core from the Windows Features
When you start with a Specific Page while debugging your project, and you are using Local IIS,
you might have filled a wrong value in the Specific Page textbox.
(via Project Properties > Web > Start Action > Specific Page)
Wrong configuration:
Specific Page: "http://localhost/MyApplication/Start/SpecificPage.aspx"
Project Url: "http://localhost/MyApplication"
Right configuration:
Specific Page: "/Start/SpecificPage.aspx"
Project Url: "http://localhost/MyApplication"
Note: Ignore the quotation marks.
If you are okay with using the built in Visual Studio Development server or you don't want to or cannot install IIS, you can change the web server the project uses by going into
Project Properties (right click project in solution explorer and select properties)
select Web tab
select "Use Visual Studio Development Server".
I don't know how it happened to me, but somehow this option was changed to "Use Local IIS Web Server" for one of my projects.
This resolved the issue on Windows 10 after the last update
go Control Panel ->> Programs ->> Programs and Features ->> Turn Windows features on or off ->> Internet Information Services
But based on previous response it doesn't work unless checking all these options as on pic below
For me, it was happening because I had switched over to "Run as Administrator". Just one instance of VS was running, but running it as admin threw this error. Switching back fixed me right up.
Modify was greyed out for me, but adding the IIS Management Console under programs and features fixed this for me. Also on Windows 10 fall update.
I got this issue when trying to run a project targeting Framework 4.5 in VS2017. After changing it to Framework 4.6.X it got fixed by itself.
Navigate to Control Panel > Programs > Programs and Features and repair the IIS Express.
Restart the visual studio.
To turn on the IIS is not recommended as other comments suggests if you are not using your system as a live server. For development purpose only IIS Express is adequate.
This is my friend's his project that I need, it works perfectly fine but here it struggles to start up, giving this error:
Severity Code Description Project File Line
Error The "GenerateResource" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Build.Tasks.ResGenDependencies.GetResXFileInfo(String resxFile)
at Microsoft.Build.Tasks.GenerateResource.ShouldRebuildResgenOutputFile(String sourceFilePath, String outputFilePath)
at Microsoft.Build.Tasks.GenerateResource.GetResourcesToProcess(List`1& inputsToProcess, List`1& outputsToProcess, List`1& cachedOutputFiles)
at Microsoft.Build.Tasks.GenerateResource.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() RecipesApp
I've read many solutions: this is my Obj folder if this helps any:
Deleted my entire 'obj' folder and it seems to work.
The temporary solution seems to be this:
completely delete all build outputs and build again (bin and obj directories)
This seems to be a known bug in the RTM of Visual Studio 2015 (or better said in the MSBuild tool which Visual Studio uses). changing files from windows explorer or overwriting Solution parts or even changing the directory of project are known cases of this incident.
the issue is that an internal cache gets interpreted incorrectly on the old bits, causing this crash.
So delete the bin and obj folder from your project and try again.
The fix seems to be deployed in Visual Studio 2015 Update 1. If you haven't installed that yet, I would give that a try.
The problem:
I'm building a c# 4.0, MVC 3 based web app. I'm using SQLite as a database.
When I start the app, I get this error:
Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. An attempt was made to load a program with an incorrect format.
This is the fusion assembly load trace:
=== Pre-bind state information ===
LOG: User = Steve-PC\Steve
LOG: DisplayName = System.Data.SQLite
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.Data.SQLite | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/Steve/Documents/Visual Studio 2010/Projects/EMMA3/EMMA_Web/
LOG: Initial PrivatePath = C:\Users\Steve\Documents\Visual Studio 2010\Projects\EMMA3\EMMA_Web\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Steve\Documents\Visual Studio 2010\Projects\EMMA3\EMMA_Web\web.config
LOG: Using host configuration file: C:\Users\Steve\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/Steve/AppData/Local/Temp/Temporary ASP.NET Files/root/6454c2d1/d37faccb/System.Data.SQLite.DLL.
LOG: Attempting download of new URL file:///C:/Users/Steve/AppData/Local/Temp/Temporary ASP.NET Files/root/6454c2d1/d37faccb/System.Data.SQLite/System.Data.SQLite.DLL.
LOG: Attempting download of new URL file:///C:/Users/Steve/Documents/Visual Studio 2010/Projects/EMMA3/EMMA_Web/bin/System.Data.SQLite.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
I am using:
Windows 7 x64
Visual Web Developer 2010
IIS Express 7.5
System.Data.SQLite x64 1.0.77.0
I've Googled around a lot and the general thought seems to be that this is related to running a 32 bit assembly on a 64 bit system or vice versa.
Things I've tried:
Switch to IIS Express from the VS built in web server. Apparently the built in server can only cope with 32bit applications and IIS Express can do both. No change.
Make sure you're using the 64 bit version of SQLite. Originally, I was using the regular version but changing to the 64 bit version does not seem to help.
Enable the '32 bit app on win 64' setting in IIS. (In IIS express, this is done using appcmd.exe - appcmd set apppool /apppool.name: "" /enable32bitapponwin64:true). Again, this made no change.
Uninstall/reinstall Sqlite. No change.
Create a simpler version of the project to make sure everything is clean and narrow down the cause. This lead me to the 'steps to reproduce' below but hasn't really helped me.
Steps to reproduce:
Create new MVC 3 web project.
Run it and see that it works.
Use Nuget to add a reference to SQLite x64.
Run site again and it will give this error.
So in summary - I'm getting the error above, it's definitely due in some way to SQLite, I seem to have everything 64 bit, but it still doesn't work. Any ideas?
Thanks in advance.
Figured this out some time ago and forgot about this question.
The answer was to remove SQLite x64 and install SQLite x86... Simple as that. Seems weird when I'm building a 64 bit assembly on a 64 bit version of windows but there we go.
The class libraries that actually have the data access logic still reference the 64 bit version of SQLite but for some reason the actual web project has to reference the 32 bit version.
If you get this error when attempting to run the web application from within VisualStudio, then it is because the built-in webserver is 32-bit only. If you wish to debug / run with 64-bit from within VisualStudio, check out the Cassini project. There are instruction to build a 64-bit version of cassini and use it instead of the VisualStudio default web-server.