Build task exits with code -2146233082 - c#

I have problem. When I build my C# .NET 4.5 project, I get this result from a custom build-task:
The command ""C:\Program Files (x86)\Microsoft\Contracts\Bin\ccrefgen.exe" "#obj\Debug\DataStructuresccrefgen.rsp"" exited with code -2146233082.
But it isn't a problem of Microsoft Code Contracts, since it has worked before for weeks without any strange errors. Additionally, "PowerShellTools Host Service" crashes at start of Visual Studio. Also, "vshost32.exe" crashes sometimes.
I already repaired Visual Studio and rebooted my PC, but that doesn't solve the issue.
I did some research on the issue and from Google I got only some comparable results who point to a Microsoft Hotfix that applies to .NET 3.5, but nothing that applies to .NET 4.5.
Does someone has a suggestion?

Well, I fixed it. As it turned out, I should not have installed .NET 4.6 preview on my Windows 7 workstation (https://www.microsoft.com/nl-nl/download/details.aspx?id=44928).
Then, I tried to enable "RyuJIT" with the register key HKLM\SOFTWARE\Microsoft\.NETFramework\AltJit
The only effect of enabling RyuJIT on Widnows 7 was that it started to destroy many (but not all) .NET assemblies at runtime
Removing .NET 4.6 Preview and the HKLM\SOFTWARE\Microsoft\.NETFramework\AltJit key from the Windows Register solved the issue.

Related

ClickOnce stops silently after "Verifying application requirements. This may take a few moments"

I upgraded the.Net Framework of a WPF application that I support from 4.5 to 4.5.2 and published the application. I also included.Net Framework 4.5.2 and Windows Installer 4.5 with the setup by following the instruction from the link below and some other articles on the internet.
https://msdn.microsoft.com/en-us/library/hh873130%28v=vs.140%29.aspx
However, after users go to the install URL and install the application on the latest version of Windows 10(version 1709) and try to run the app, the app stops silently after showing this "Verifying application requirements. This may take a few moments" message for couple seconds.
After spending much time tearing my hair, finally found the solution to this issue. The reason the app was crashing before it even got started is that because Visual C++ 2013 re-distributable was missing from the deployment package.
Below are the two articles that helped me solve this issue.
Deploying WPF Application with 3rd Party DLLs
https://www.codeproject.com/Articles/1058700/Embedding-Chrome-in-your-Csharp-App-using-CefSharp

.NET Framework version causing different behavior between two different machines?

I'm currently trying to debug a weird issue I'm having with some RESTful API calls. I built an Angular 2 scaffold and used the publish feature to create a standalone build which users can run by opening a command prompt and typing in "project --debug" -> this will start the scaffold service and users can submit API calls to retrieve data from files. This works perfectly fine on my machine and I can make the API calls just fine, but I have another computer where the results are different. The other computer always fails and lands in an Exception block when accessing a specific type of file.
I'm wondering if this may have to do with some kind of version mismatch/difference on the .NET Frameworks and/or Microsoft Visual C++ redistributables. The published build (original computer) was built using .NET 4.5.1 while the other computer only has 4.6.1 installed.
Has anyone encountered a similar situation where the exact same build yields different results? I'm currently uninstalling versions of .NET and redistributables to test this hunch out but I'm curious if some of you may have had a similar experience.
Seems like my issue is related to the Microsoft Visual C++ 2015 Redistributables - I removed the 2015 redistributables from the original machine (because it turns on the other machine did not have them), and I received the same results. Going deeper, I'm guessing this is because one of the DLLs was built using the 2015 redistributables.

Having problems converting a service made on framework 4.5 to 4.0

I created a service that runs fine on framework 4.5. I can install it and run it and everything is great.
However, when I went to deploy on a local server, they are only running Windows 2003, and the framework on it is still 2.0.
I talked to the guy in charge and informed him that I am using a lot of Linq commands and it would be very hard for me to rewrite all of that code, so he agreed to upgrade to 4.0 for me (the latest framework server 2003 can handle).
So I converted all of my projects to target 4.0, ran it in debug mode and the service (running as an application) runs fine.
The service installs fine (installutil.exe servicename.exe) but when I do a "net start" on it, it immediately returns "the service is not responding to the control function." I get no other useful information from the event logs.
As I understand it, this usually means that it has taken too long to start up, but the timeout is definitely set to 30000ms and it returns this well under a second. Nothing has changed other than converting the projects to framework 4.0 and I can find no information about "downgrading" from 4.5 to 4.0 and what I might be missing.
Does anyone have any ideas?
I'm not sure why it wasn't affecting me when it was set to framework 4.5, but some of the dlls were compiling to Win32, and the exe was compiling to x64 so it wouldn't load the dll correctly.
I manually made them all target x86 and the problem went away.

application running fine on winXP and not on win7

I have an application written in C# and built using Visual Studio 2005 on winXP. It is working fine on winXP. If i try to run it on win7, I am getting an error called ".NET Framework Initialization Error." "Unable to find a version of the run time to run this application." Application target framework is .Net 2.0. How can i make it run on win7 ?
Try going to the files properties and go to compatibility then click on run in compatibility mode and then click on windows xp. this should fix the problem.
here's a screenshot to help. Ignore the fact that the options are blanked out they shouldn't be on yours.
try to Remove the .Net framework from your computer and then install .Net framework components through Windows Update .
read it maybe helpful:
http://answers.microsoft.com/en-us/windows/forum/windows_xp-performance/net-framework-initialization-errorunable-to-find-a/6ef76069-f481-48ad-ac30-d03e5c4d9638

C# application crashes before start

I come to you because I'm desperate. I've developed a GTK# application in C# with the latest MonoDevelop. It's built for .NET framework 4.0 / x86, and the only external library it uses is the official Mysql .Net connector. It's meant to run under Windows XP.
It's the first application I make with this IDE. I was very happy with the results and the development time, but the deployment is a real headache.
It works perfectly on the development machine. The debug is clean. Everything's okay.
Then, as I couldn't find any information about the deployment, I installed a clean XP to try it and see what do I should install on the client's machine.
I've installed the SP3, .NET 4.0 and copied the release package with all the DLLs mentioned in the build log (that made it work outside the MonoDevelop in the development machine). But I'm getting a "the application has encountered a problem and needs to close" error, with no exception, in kernel32.dll, offset 0012aeb.
I've tried to install the .NET 3.5 before the 4.0, updated IE (just in case...), copied more GTK# and Monodevelop DLLs to the exe's folder, installed the Mysql .NET connector, installed Mono 2.8... But nothing. Still getting that unexplained error.
Google and StackOverflow searches didn't help me. I've researched and tried a lot of things in the last twelve hours or more without moving from this machine.
Do you have any advice? What can be causing it? Is there any way to debug the exe (without installing VS...)? Does anyone know what are all the dependencies of this kind of executable?
WinDbg can help you figuring some JIT trouble...
Even though it aint intuitive and require skills, Worth a try. might pop something up.
If it's meant to run under Windows, then you should probably compile it with the Visual C# compiler.
However, more related to your problem - get a debugger in your deployment machine and run the application on it. This is the best way to figure out the problem because we really can't guess it.
Mono Application Deployment Guidelines
There are several options to installing Visual Studio on your production machine, one of them is the Remote Debugging Monitor. It does not require a Visual Studio installation. You can copy the files from your development machine to your server. I've got them under C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger.
You can also use it for Remote Debugging of a Project Built Locally.

Categories