I'm building a NET6 local multiplatform console application as shown:
But even with a single "Hello World" and without any reference or package being called, everytime I debug-execute the code a lot of "Webview2" is loaded on the Windows processes.
Worst: even stoping the debug session, these modules remains active and they seems to close only if i manually finalize them in Task Manager
Since the application is not an ASP.NET nor a Winform application, why Visual Studio 2022 loads Webview2?
Can I disable it?
Related
After creating a new project using the "ASP.NET Core Web App" template, when I run the project, I want the console window to automatically be brought to the foreground. Since I'm mainly developing a web API, I don't want the browser to launch (which I've done in launchsettings.json), but do want the console window to show.
I've verified that this is the default behaviour when creating a .NET Core 6 Console app, yet I can't find the settings responsible for this desired behaviour.
It can be achieved easily just by changing a debug setting. It may be a little bit different in old versions of Visual Studio!
VS2022
1. Open Launch Profiles window:
2. Select relevant profile from opened window and change Launch browser setting(uncheck it)
3. Save the change if there is any Save button. and run the project.
In VS2019, when I start my ASP.NET Core 5 app, which just exposes an API, if that matters, a console window pops up for that app. There used to be some setting to decide whether to run it as a console / standalone app or host it in IIS Express. I always preferred the console / standalone version because it lets me see the logs in realtime.
In VS2022, when I start the very same project, no window appears at all, and, interestingly, neither do I see IIS Express starting up.
How can I get back to having the project start as a console app? (Except starting it from the command-line and then attaching the debugger.)
UPDATE:
ok, so at long last I noticed that, strangely, a minimized console window is being created and because I start a dozen projects (microservices), I didn't notice before, and procexplorer telling me that the executable had no window added to the confusion. So this is much less problematic, albeit still weird - why does this one particular application not start un-minimized? The only difference it has to all the other executables is that it uses ASP.net core while the others (all background services communicating via messagequeue) don't.
and this only in VS2022, in VS2019 all executables including this one start unminimize
You have to make sure, that you selected "IIS Express" as your debug profile
VS 2022 debug profile
I believe you are looking for this. Follow the steps highlighted in in each image:
Go to your project properties:
Then you will see that the console is open in the task bar.
In Visual Studio 2022 this is currently NOT POSSIBLE
When compiling a ASP .Net Core project without debugging in Visual Studio for Windows, subsequent changes to C# files trigger a new seamless compilation when reloading the website.
I tried it under VS Mac, but unfortunately it does not work. I either have to manually recompile the project, which open an unnecessary new browser window or lauch the command line "dotnet watch run" but it runs a compilation each time a file change an not each time I reload the website and there is at least 1 file change.
Is there a way to achieve the same behavior of VS Win or is it a feature of IIS Express?
I have a MVC4 application, which loads some DLLs. Basically, the architecture of the MVC application is this: the app receives some jobs from the user, it calls the processing functions from dlls and in the end, emails the results to the user.
All dlls are compiled on 64bits, I use IIS8 on 64 bits, on Windows Server 2012R2 and VS2013.
When I run/deploy the application, its behaviour is:
Scenario1: Run from Visual Studio 2013 in VS2013 included web server (IIS Express) in Debug/Release Mode => works fine
Scenario2: Run from Visual Studio 2013 deployed in local full IIS8 in Release Mode => works fine
Scenario3: Deployed in Release Mode in local full IIS8 and run directly from browser, without having open VS2013 => IIS crashes with An unhandled win32 exception occurred in w3wp.exe.The Just-ln-Time debugger was launched without necessary security permissions. To debug this process, the Just-ln-Time debugger must be run as an Administrator. When I open the debugger, the error is: A heap has been corrupted.
In event viewer, the logs are:
Faulting application name: w3wp.exe, version: 8.5.9600.16384, time stamp: 0x5215df96
Faulting module name: ntdll.dll, version: 6.3.9600.18821, time stamp: 0x59ba86db
Exception code: 0xc0000374
I know that exception code 0xc0000374 comes from Heap corruption.
I debugged IIS using DebugDiag and Application Verifier, with Full PageHeap flags activated.
The relevant part of the stack for the crashing thread is:
.NET Call Stack
mscorlib_ni!DomainNeutralILStubClass.IL_STUB_PInvoke(IntPtr)+68
[[InlinedCallFrame] (Microsoft.Win32.Win32Native.LocalFree)] Microsoft.Win32.Win32Native.LocalFree(IntPtr)
mscorlib_ni!System.Runtime.InteropServices.Marshal.FreeHGlobal(IntPtr)+2d
Species_DLL.Class1.Species_MetaModel()+b955
rIAMTestMVC4.Impressions.SpeciesUtil.use_Species_Integrated(Int32)+1efd
Full Call Stack
vrfcore!VerifierStopMessageEx+6f4
vrfcore!VfCoreRedirectedStopMessage+90
verifier!VerifierStopMessage+a0
verifier!AVrfpDphReportCorruptedBlock+2a7
verifier!AVrfpDphCheckNormalHeapBlock+c8
verifier!AVrfpDphNormalHeapFree+27
verifier!AVrfDebugPageHeapFree+af
ntdll!RtlDebugFreeHeap+47
ntdll!RtlpFreeHeap+74c85
ntdll!RtlFreeHeap+368
vrfcore!VfCoreRtlFreeHeap+1e
KERNELBASE!LocalFree+2e
mscorlib_ni!DomainNeutralILStubClass.IL_STUB_PInvoke(IntPtr)+68
[[InlinedCallFrame] (Microsoft.Win32.Win32Native.LocalFree)] Microsoft.Win32.Win32Native.LocalFree(IntPtr)
mscorlib_ni!System.Runtime.InteropServices.Marshal.FreeHGlobal(IntPtr)+2d
Species_DLL.Class1.Species_MetaModel()+b955
rIAMTestMVC4.Impressions.SpeciesUtil.use_Species_Integrated(Int32)+1efd
Are there any differences between Scenario2 and Scenario3? Is there any heap protection that is done by VS?
I also run the same scenarios on Windows7 with IIS7 and works fine on all three.
I don't have access to DLL code, but as I mentioned, the same code runs perfectly on IIS7/Windows7 and on IIS8 from Visual Studio.
LE: There are two functions shown in call stack:
rIAMTestMVC4.Impressions.SpeciesUtil.use_Species_Integrated => This function is from MVC controller, which calls one dll
Species_DLL.Class1.Species_MetaModel => This function is from dll, called by previous function.
How can I resolve the problem of scenario3? What are the differences between these scenarios?
Thank you,
I had similar issues but i resolved mine by changing the project build to x86 to compensate for 32 bits.
Did you run VS2013 as an administrator? if so, then this is what prevented the error from happening with VS, and happens with IIS only.
It looks like the IIS application pool is having a problem reaching those DLLs, and this problem didn't occur with VS2013.
Update: Just add the permission to the pool itself to access the folder:
Select the folder that has your DLLs Right click and select
"Properties"
Select the "Security" tab Click the "Edit" and then
"Add" button
Click the "Locations" button and make sure you select the local
machine. (Not the Windows domain if the server belongs to one.)
Enter IIS AppPool\DefaultAppPool in the "Enter the object
names to select:" text box. (Don't forget to change "DefaultAppPool"
here to whatever you named your application pool.)
note: steps are copied with some changes from here.
To know or change the application pool that runs your application: when you open IIS manager and select your application from the tree on the left, find it in Advanced Settings down the Actions Pane on your right.
To change the identity of the pool , you'll find them under the machine in the tree on your left.
Check this article on how to specify the identity of the application pool.
Before beta8 it was possible to start a Web Application, change some of the code (e. g. the ViewBag.Message of the About-View), save and refresh the browser - voilá, the new Message is displayed without rebuilding the project.
Now when creating a new Web Application with beta8 which uses DNX and Kestrel this seems no longer to work. Any idea why?
Beta8 contains a new library called 'dnx watch' which monitors your project files for changes during execution and automatically rebuilds the project. Install it by running the following from a command prompt:
dnu commands install Microsoft.Dnx.Watcher
Additionally, make sure you've installed the beta8 web tools for Visual Studio.
Finally, make sure you're not running in debug mode as code changes will not reload projects while running with the debugger attached. CTRL+F5 will start your web project without the debugger.
You can read up on this and the other changes in beta8 here:
http://blogs.msdn.com/b/webdev/archive/2015/10/15/announcing-availability-of-asp-net-5-beta8.aspx