Unable to find an entry point named 'GetCurrentPackageId' in DLL 'kernel32.dll' when using Visual Studio debugger - visual-studio

I have an ASP.NET which calls an asmx web service. It works fine on one machine with or without using the debugger in VS 2010. On another machine, it gives an error "Unable to find an entry point named 'GetCurrentPackageId' in DLL 'kernel32.dll'" in the web service constructor and when launched in the debugger. If the app is running without the debugger it runs fine. If the debugger is attached to w3wp.exe, the app runs fine and breakpoints are reached. This is in Windows 7 64bit. The same app exhibits the same behavior under VS11beta.
Any ideas why I get this error when using the debugger.

I recently noticed the same thing started on a machine that previously worked just fine. The only change that occurred was the installation of Visual Studio 2011 Ultimate Beta 1. The problem has unfortunately persisted after the uninstall of 2011.
More specifically, it's happening with projects that were opened with the beta.

I was experiencing this problem and deleted my [projectname].suo file. This file exists in the directory where the .sln file is located.
Once I did this the problem no longer exists.
Be sure to back up this file before you try this, and know that you may have to reset a few things (startup project, etc)

The exception is thrown and handled deep inside the .NET Framework. However, you have enabled the option to break even on properly handled exceptions. (I know, because I did too.) You can safely disable that for EntryPointNotFoundException.

Seems like Microsoft is working on this issue
https://connect.microsoft.com/VisualStudio/feedback/details/732334/unable-to-find-an-entry-point-named-getcurrentpackageid-in-dll-kernel32-dll

Related

Unable to Launch IIS Express Web Server - VS 2015 Community

I am developing a web project and I am not being able to test it using the IIS Express from the Visual Studio 2015.
I have googled this error and I found many references to it on the internet, but I believe that my case is different, because there is no other error message displayed besides "Unable to Launch IIS Express Web Server".
I've looked at the Windows Event Viewer and I got these errors below:
The worker process failed to initialize correctly and therefore could not be started. The data is the error.
The Module DLL C:\Program Files (x86)\IIS Express\aspnetcore.dll failed to load. The data is the error.
I also tried to launch the IIS Express directly using: c:\Program Files (x86)\IIS Express>iisexpress.exe /trace:error and I was successfull, so I think that the problem must be somewhere within Visual Studio and that my port (8080) is free.
Does anyone knows what else I can do?
If you are working with .NET core/ASP.NET core application then
please make sure you have installed these-
.NET Core SDK
VS 2015 Tooling Preview 2
If it is appeared to be solution-specific then-
Look for applicationhost.config file at <solution-name>\.vs\config\applicationhost.config location
Try removing this file and run solution again.
See if this helps.
I had the same error few days ago. I tried many things but i think Repairing DotNetCore.1.0.0-VS2015Tools.Preview2.exe fixed the issue.
Also, check whether you can run the web app in Kestrel web server. If you can run then worth checking web.config file for the presence of aspnetCoreModule tag properly.
This link might be helpful -- https://github.com/aspnet/Home/issues/1583

IIS Express crashes when starting a site from visual studio

I started encountering this problem after installing the Visual Studio 2015 RC; I am no longer able to debug web projects from Visual Studio 2013.
My projects build fine and VS launches a browser - I can see in my output that iisexpress.exe loads all the relevant DLLs for the project, but then right when I would expect to see my website, iisexpress.exe stops running and Visual Studio stops debugging. All the output Window tells me is this:
The program '[3724] iisexpress.exe: Program Trace' has exited with code 0 (0x0).
The program '[3724] iisexpress.exe' has exited with code -532462766 (0xe0434352).
Looking in the event viewer I see the following crash info for iisexpress.exe:
Faulting application name: iisexpress.exe, version: 8.0.8418.0, time stamp: 0x4fbaa9e8
Faulting module name: KERNELBASE.dll, version: 6.1.7601.23040, time stamp: 0x553e86a2
Exception code: 0xe0434352
Fault offset: 0x0000c44d
Faulting process id: 0x1b40
Faulting application start time: 0x01d094d5c74c69d5
Faulting application path: C:\Program Files (x86)\IIS Express\iisexpress.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
I've tried reinstalling IIS, deleting my local IISExpress folder, and still no luck. Anybody have an idea how I can get IIS running again?
In your project folder find the hidden .vs folder and delete it. This solved the problem for me.
On my code this error was caused by an infinite loop, try to check if you have a loop like that in the following example:
public int InfinitiveLoop(long param)
{
return InfinitiveLoop(param);
}
Considering faulting module is not on IISExpress's dll files, this might be caused by either your web project or an unknown VS issue.
One thing we can try is to start the problematic web site without using VS.
You can execute IISExpress.exe with /siteid option. You can find the site id from applicationhost.config which is placed on the config of IISExpress directory.
For example, if the site id is 2, you can run this command:
"\Program Files\IIS Express\iisexpress.exe" /siteid:2
If the web site still does not work, showing the Access Violation issue which you ran into when you launched the website via Visaul Studio, maybe you will need to narrow down the issue why that happens.
If the web site runs okay if you don't use Visual Studio, it might be caused by some Visual Studio issue. In that case, considering you used RC build of Visual Studio, you will need to upgrade VS 2015 first and check if the issue is still reproducible.
Try deleting .vs folder from your project folder.
Found the solution here
On top of all answers here, I believe this answer can be helpful to figure it out why this issue occurred: System.StackOverflowException. I started my application without debugging and the two errors were IIS crashed and vstest.executionengine.x86.exe has stopped working (when trying to run the unit tests). Unfortunatelly, in the window event viewer I wasn't able to see the actual error. I saw it just when I started my application with debugger. So, if you have one of these errors, before doing some other investigations, please check your code. Because I was dumb, it took me 1 hour of my work time :(
In my case it was a circular reference caused on my part. There was no error, clue, output, any trace of why it was happening which would have saved me an hour or two.
I just had to delete .suo file of the project and rerun. That solved the problem.
I used #kernowcode solution of deleting the .vs folder, and it worked for me. But if you are a newbie like me, you probably have no clue where this .vs folder is.
I found it by opening my folder in the file explorer at the root directory. If you don't see it, you need to show all hidden files. Here are some pictures
1. Right-click on the project and click on "Open Folder in File Explorer"
2. At this point you probably will already see the .vs folder and you can delete it but if you don't, click on view and make sure hidden
items is check
3. Delete that .vs sucker and cry no more!
None of the above answers worked for me but I finally found what my issue was. Hopefully this will help someone down the line.
First run IIS Express from command prompt to validate that the site can or cannot be run.
Im my case, i got an error saying that C:\Windows\Microsoft.NET\Framework64\v4.0.30319\CONFIG\web.config had malformed xml on line 14. Looking at that line in the file it just said null null null null null etc.
The fix for me was to replace the web.config file with one from my coworkers'. IMPORTANT: you must get the file from someone running the same version, ie if you are VS2015 get a copy from someone running VS2015. If you get it from someone running a different version you will see an error saying it could not load an assembly from the manifest.
Hopefully this helps someone that has tried all the suggestions above. I think the cause of this for me was updating from trial mode and adding a product key within VS2017
Clean and build project and it will work
I had a similar issue and this worked for me:
(i). Deleted IISExpress folder in Documents.
(ii). Deleted almost everything in temp folder %temp% (may not be necessary but ...)
(iii).Went into Control Panel\Programs\Turn windows features off and on and enabled IIS.
(iv)Launched VS2013 project and opened and ran much faster with no apparent issue.
My symptoms:
iisexpress.exe' has exited with code -2146233082 (0x80131506)
Starting in VS crashes IISExpress on startup in System.Web without any logging and tracing
Starting is possible (As Jeong Hwan Kim mentioned) from command line, but OData und WebAPI do not work
Solution:
I found out, that the application starts from VS when I remove the WebAPI and OData Route (inclusive EnsureInitialized). So I updated all WebAPI libraries to version 5.2.4 and System.Threading to 4.3.0 and all problems vanished.
Open new visual studio project and copy and paste the same project it worked .Sometimes it might be due to visual studio issue.
Thanks
I just battled with this and my issue was having a different version of Autofac.dll in my web folder than in sub projects. So if you have tried all of these options and nothing works, check your DLL versions...
Keep in mind as I didn't realize, the .vs file is a hidden file on Windows 7. Not sure about other OS.
The problem was caused for me when a method called itself - resulting in an infinite loop.
Resolution, remove the call from the method
In ASP.Net Core, I was missing .Run() method in WebHostBuilder in Program.Cs.
Ideally, the code inside Main method should look something like below:
CreateWebHostBuilder(args).Build().Run();

Visual Studio 2010 - Cannot Register Assembly

I am running Visual Studio 2010 on a Windows 7 VM and trying to build a fairly large solution. When I try to do so, I get the error:
Cannot register assembly "C:\Development\ProjectName\Source\bin\Debug\AssemblyName.dll" - access denied. Please make sure you're running the application as administrator. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
I have taken the following steps:
Confirmed that I am in fact running Visual Studio 2010 as administrator.
Restarted the VM.
Confirmed that the assembly does exist exactly where Visual Studio is looking for it.
Confirmed that administrator has full control over the relevant file.
Cleaned and rebuilt the project (multiple times).
I have also found that building the project which creates AssemblyName.dll, manually registering it with RegAsm, and then building the project which requires AssemblyName.dll does not result in an error, but this is not a desirable workaround as it requires manual control. Can anyone give me some advice on how to solve this problem?
Many thanks.
This particular issue happens when you are building an assembly project which has the 'Register for COM interop' checked under the Compile tab of the project properties. As Stephane said, you must right click -> Run as Administrator in order for it to register automatically.
If you already have the compiled assembly from a different machine, you can alternatively register it manually and reference the compiled assembly with the project to by-pass the issue.
When you ran VS2010, did you right-click and select "Run as administrator"? If not, it actually runs as a lower priviledged user. Once I selected "Run as administrator", this problem went away.
I also ran into this error even though I was running VS 2015 as administrator.
In my case I found that manually cleaning up (ie deleting) bin\Debug\*.* for the project resolved the issue. Apparently some kind of file permissions or something was preventing the operation, and the error message may have been incorrect.
I'm not sure what was causing the file 'conflict' in the first place.
Similar to what UuDdLrLrSs said, when I tried to clear the bin folder, Windows gave an error on file access. Apparently another process was using the file - in my case, Microsoft Access.
After closing the associated program that had a file handle, the project built fine. (Although I'm still a little confused as to why it had a file handle on debug assemblies...)

Dotfuscator 4.10 project in VS 2012 bugs while trying to save .dotfuproj file

I recently installed Dotfuscator 4.10 on my computer and I already has VS 2012 working on it. Everything worked fine up to the point when I tried Dotfuscator embedded in VS (I mean the standalone GUI app works perfectly).
Just for the try, I created a small solution (no TFS/VSS) with a C++ /clr app, a C++/clr dll and a C# app.
I then added a Dotfuscator project. To this project I added the output from the three dll/exe other projects.
When I tried to rebuild the solution, I was asked to save the .dotfuproj file. Strange and abnormal behaviour, the file should be saved automatically and without prompting me. OK, I chose to overwrite the existing file (what should have been done automatically after all.) I got the error Object reference not set to an instance of an object. I had to cancel the operation and could not build the solution.
Note that I observed the same behaviour if I tried to save the dotfuproj file under an other name. Also, the file is not R/O.
My question: has someone experienced this problem? Any solution? Thanks for your help!
You can try deleting your Dotfuscator project and then creating a new project. If that does not work, try using direct input to the Dotfuscator project, rather than using the output of another project within your solution.

Visual Studio 2010 Debugging issue

I have a problem with debugging my Silverlight 4 (hosted in ASP.NET MVC2) in Visual Studio 2010. It was working fine until I tried remote debugging. After a lot of hassle I managed to configure remote debugging but it worked only occasionally. So I created a new app and copied my classes one by one, but now I see I cannot debug not only remotely but also "locally" in development server. Breakpoints in Silverlight code says "The breakpoint will not currently be hit. No symbols have been loaded for this document." Strangely enough, if I run my app it will show my previous code results. (It may be relevant, before this problem I noticed that my app doesn't update immediately when I publish to remote web server. So I did the following for all projects in the solution:
//In AssemblyInfo.cs in Properties folder
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]
I'm adviced that it will automatically generate version numbers so, when I publish to remote server it will immediately take into effect, which seems working well.)
However, if I change development server's port number, in the properties page of my ASP.NET MVC app, then I'm able to debug locally (about remote debugging I just gave up). But, it didn't last long; after some updates in my code the problem suddenly reoccurs. I guess development server deploys my app somewhere in a folder per port number, but where? May be, if I delete that folder, will the problem be solved? Can somebody advice me what to do?
There seems to be bug in Visual Studio 2010; see:
silverlight 4, dynamically loading xap modules

Resources