CS0012 Error when building the getting started Xamarin Android app - c#

I am following along with the getting started tutorial:
https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-dotnet-backend-xamarin-android-get-started-preview/
I can successfully work the steps up through "Publish your server project to Azure". However, when I download, open and build the Xamarin.Android app I have issues. Specifically, the output window says the build was successful, but the error window indicates that there are 14 errors, all of which are CS0012.
I understand that the "System.Runtime" assembly isn't being referenced, but no solutions I have been able to identify on MSDN or on StackExchange seem to correct the issue.
Any help would be appreciated!

I was able to solve this issue, plus a number of others (related to missing references) by adding the references using the "server" portion of the getting started demo. I also had to update all of the nugget packages as the references I added were in conflict with some of the existing references in the project.

Related

using Zxing.Net Mobile for forms does is not recognize

I am new in Xamarin.Forms and I want use the bar code scaner by Zxing.
however I install the plugin form nuget:
1)ZXing.Net.Mobile for Forms
2) ZXing.Net.Mobile. -> install it since I read somewhere it would help my problem but its not.
as far as I understood I need to add this line: to the Android project in main Activity
However alotugh I install the packages I am still getting an error of:
The type or namespace name 'Andorid' does not exist in the namespace 'ZXing.Net.Mobile.Forms' (are you missing an assembly reference?) ScannerZXing.Android
what can I do? (perofrm clean and rebuild for the project didn't help)
also would like to add that it is added in the referecnes of the projects.
Thanks for the ansewrs.
In my case the reason was that I installed only ZXing.Net.Mobile.Forms. After installing ZXing.Net.Mobile it`s gone. (two libraries need to be installed)
UPDATE: After trying to run the project I discovered that you actually need both Nuget Packages
Previous: Just in case anyone had the same issue as me there are actually two ZXing.Net.Mobile packages both of which by Redth. They both have the exact same description as well unfortunately. I tried the first one which at the time of this writing had the most downloads... however it produced the error as described. By uninstalling and reinstalling the second I resolved the issue:

The type or namespace name 'Membership' does not exist in the namespace 'Microsoft.AspNet'

I'm trying to maintain an application that contains the following line in several different files:
using Microsoft.AspNet.Membership.OpenAuth;
I've tried everything I could find. Removed and re-added the reference; cleared the MEF cache and rebuilt; added a different file as a reference. Nothing works. It's bizarre because VS2017 doesn't report this error in the Error List window, but it does show up in the Output window. Anyway, can someone please suggest a possible solution that maybe I haven't tried yet? Thanks.
I was able to compile the project and I will describe how I got it.
1 - I delete all using Microsoft.AspNet.Membership.OpenAuth; and build project.
2 - After build the code show many errors I use the resource of VS2015 help fixes errors on code Show potential fixes and set again using Microsoft.AspNet.Membership.OpenAuth; build project.
3 - Set a new framework 4.6 and build project.
https://drive.google.com/open?id=0B4aywYtmwk6lT1dDNnIxRmtQcUk

Could not find Microsoft.DiaSymReader.Native.x86.dll

I'm trying to build a project in Rider using Mono and I can keep on getting this error:
Error CS0041: Unexpected error writing debug information -- 'Windows
PDB writer is not available -- could not find
Microsoft.DiaSymReader.Native.x86.dll'
Does anybody have any idea why I'm getting this error? I've tried searching for it online and all I could find was a previous SO question that never got answered: Monodevelop fails to build, can't find Microsoft.DiaSymReader.Native.x86.dll'
I have no idea where to start. Any help would be appreciated.
Right, the library exists. but on Visual Studio, using NuGet link to nuget package it will add the reference and add the Microsoft.DiaSymReader.Native.(arch).dll into //debug, once you build it. So, you must find the way to get such .dll.
Once you have the .dll with the arch you need. Proceed to add as a external reference on Monodevelop see this the dll.
Begin to build.

Windows Service: The module was expected to contain an assembly manifest

I've got a C# program that was built as a Windows service. I tested this last week and it worked fine, but today I'm getting an error.
When I try to install using installutil.exe, I get the error:
Could not load file or assembly [file name] or one of its dependencies. The module was expected to contain an assembly manifest.
Rebuilding the project had no effect. I also noticed in task manager that the service is still listed and running. On the chance that might be interfering with the installation, I tried uninstalling via installutil, but got the same error message back again.
I've seen many other questions related to this error, but most of them have either no answer, or a very specific answer related to their unique situation. Has anybody had this happen, and how did you fix it? Any ideas are appreciated.
Update:
I successfully uninstalled the service using the "sc delete" command via command prompt, but I'm still getting the same error from installutil on trying to reinstall.
Update 2:
Just for the sake of trying something, I deleted the bin folder from the project, reopened the solution, and did a clean and build. It still won't install, but now I've got a different message:
This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Question:
What would cause there to be a mismatch in runtimes? As far as I know, I've only used .NET Framework 4.5 and haven't deviated. Is there a value I should be looking at / changing to fix that?
Update 3:
Here's what I've tried so far:
One answer suggested the version of installutil being used matters. I'd been running v2.0.50727, but there's also a v4.0.30319 I hadn't thought to try. Running this resulted in:
An attempt was made to load a program with an incorrect format...
I'd be willing to work on that error instead, if it would solve the problem. However, I'm compelled to think that's not the problem since I'd been successfully running v2.0.etc just before the first error popped up.
Inside App.config, there's a line "supported Runtime version=v4.0". I switched this to 4.5, but it had no effect good or bad.
I tried switching the target framework (under project properties) down to 4.0, but this cause an error with:
Some NuGet packages were installed using a target framework different from the current target framework, etc...
This was referring to the EntityFramework, and I'd rather not start messing with NuGet again unless it's the only way (last time it was a nightmare).
I tried installing the service on the target server (the machine it will eventually be deployed to) and got the same error. This leads me to think it's a problem with the project / solution and not the pc.
Looks like a assembly loading problem. Use the Fuslogvw.exe utility. Start it from the Visual Studio Command Prompt. Click the Settings button and click the "Log binding failures to disk" radio button. Switch back to VS and start the program and wait for the exception to occur. Back to Fuslogvw, click the Refresh button and double-click the added entry. It will show you the file it found.
One another possibility is to trying to load a .NET 4 assembly with an EXE that asked for CLR version 2. That requires an app.exe.config file that forces CLR 4 to be used.

Strange exception suddenly appears when trying to install a setup project, need help big time

Using Visual Studio 2010 to build a setup project that installs a Windows Forms application .Net 4.0 C#. It has worked fine for ages but now when I'm trying to install the finished setup file, I'm getting this error message:
Error 1001. Unable to get installed types in the "Path" assembly. -->
Unable to load one or more of the requested types. Retrieve the
LoaderExceptions property for more information.
I have been searching for answers for over 4 hours now without finding anything. This problem just came without me doing anything. Last time I build the install file was like 2 weeks ago and there was NO problem at all. I haven't deleted any reference or any code that have anything to do with the setup project.
How could this problem appear from nothing and more important, how do I fix it?
Based on the error message in your second comment, it appears that your SysDir.exe assembly has been added as a Custom Action with the InstallerClass property set to true, but either no installer classes could be found in the exe or the exe could not be loaded due to missing dependencies.
You can see the list of Custom Actions by right-clicking on the installer project, selecting View and then Custom Actions.
If your exe does not can an installer class, then you can remove it from the list of custom actions.
If it does contain an installer class, then the issue is going to be missing dependencies. If fuslogvw doesn't work for you (it has always helped resolve this kind of issue for us), you can carefully review the list of references in the exe's project and compare them to what is listed in the installer project.
The other trick that we use is to examine the install directory while the error message is displayed on the screen. We can often see that DLLs are missing by doing this, usually because the path was entered incorrectly in the DLL entry within the installer project or because a condition was set incorrectly.
Have the same error today. For me it was the project type of the class library.
I noticed that the pucture on the guide I was following had selected Class Library (.NET Framework) instead of just Class Library.
Creating the correct project type fixed the error.
https://nhvu1988.com/posts/how-to-create-msi-installer-using-vs-installer/

Categories

Resources