I have developed Asp MVC5 project on VS2012.Now i need this projet run on linux with Mono.
I have installed Mono 3.2.3 and Monodevelop 4.2.5.
I successfully build MVC5 project with Monodevelop, and it works smoothly for me when I run with debug/without debug on Monodevelop.
But when i deploy this project using Monodevelop. And using Mono command (xsp4).
Many errors occured. For example:
System.TypeLoadException
Could not load type 'System.Web.UnvalidatedRequestValuesBase' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Anyone have same problem with me ? I think Monodevelop using Mono for running ? This problem took me 3 days. But now, i still cannot solve this problems.
Please let me know why ? and how to solve this problem.
Thanks all.
I am assuming that when you say it runs with MonoDevelop you are running this on Windows and the error only occurs when you run it on Linux using Mono.
Looking at the Mono source code and the status page it seems that the System.Web.UnvalidatedRequestValuesBase is not yet implemented on Mono.
Related
All my projects are not failing to build on my Azure DevOps MacOS build host. It's a self-hosted build host. Suddenly, my projects are throwing this error when trying to build:
error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
error MSB4018: System.MissingMethodException: Method not found: System.Collections.Generic.IList`1<NuGet.Packaging.Core.PackageDependency> NuGet.ProjectModel.LockFileTargetLibrary.get_Dependencies()
I found this GitHub issue which seemed similar, but the posted solution didn't help me:
https://github.com/mono/mono/issues/13537
As mentioned in xamarin/xamarin-android#3155 this is caused by a version mismatch in nuget between msbuild and dotnet core. The solution is to update your dotnet core install to the latest stable version
I've installed the most recent .NET Core, and updated Visual Studio for Mac, but alas, the problem remains.
Another information:
When I build the same Xamarin.iOS project from my Windows machine coupled with the same MacOS build host, the app builds just fine. But I am guessing the process is probably different.
Updating both Visual Studio for Mac and .NET Core SDK again today seems to have fixed the problem.
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '1.1.2' was not found.
Check application dependencies and target a framework version installed at:
Alternatively, install the framework version '1.1.2'.
I installed Windows (Server Hosting) installer and Runtime Installer 64-bit but still facing this issue
I tired all possible solutions but nothing is working for me
please help me!
Thank You
Try running your website from the command line with command below:
dotnet YourWebApp.dll
This way you'll be able to see any errors which may be preventing your website from starting. You can then follow the erros shown and look for their specific fixes.
After following several blogs detailing how to get xUnit working with Team Services Build vNext:
http://tech.trailmax.info/2014/01/run-xunit-in-hosted-team-foundation-service/
Running unit tests in TFS/VSO Build vNext using xUnit adapter
http://www.donovanbrown.com/post/2015/06/15/how-to-run-xunit-test-with-vnext-build
None of which worked for me. From examining the build logs I get the following warnings for each of my test assemblies.
--------------------
Warning: [xUnit.net 00:00:00.1644156] Exception discovering tests from CHO.SAM.Business.Test: System.BadImageFormatException:
Could not load file or assembly 'c:\_Work\473cef3c\CHO\CHO.ALL\Tests\CHO.SAM.Business.Test\CHO.SAM.Business.Test\bin\Debug\xunit.execution.desktop.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
--------------------
Has anyone seen this before? and if so did you figure out a solution?
My thoughts are; my test projects are compiled using .NET Framework 4.6, I was wondering if this could be causing the problem? If so I would have to move over to nUnit or something as I don't feel it's right to change the compilation just to use a single test framework.
Add "/Framework:Framework45" to "Advanced/Other console options" (to run under .NET 4.5)
or
Add "/Framework:Framework40" to "Advanced/Other console options" (to run under .NET 4.0)
or
Change "Advanced/VSTest version" to "Visual Studio 2013" (to run under .NET 3.5)
This error is normally caused by a x64 compiled assembly running on x86 test runner or vice versa. Check the solution build configuration that is being run.
I had this same issue. Adding a UI test did not fix it for me. I found two alternatives that work:
use .net 4.5
OR
Set the advanced options of the VSTest task to use 2013 instead of 2015.
Hopefully this will be fixed soon.
In the end, I added a Visual Studio Coded UI test project and removed all it's contents (a class), it's empty!
I'm assuming it's added a reference or something that the build server felt it needed.
I am now getting my unit tests discovered, running and with code coverage.
Wierd!
It works, but I don't know why...
I ran into this issue when using a .Net Core class library to run my xUnit tests against a .Net Core Web Project (.Net Framework). What solved the issue for me was to change the default processor for running test to X64 in VS2015 via:
Menu Bar -> Test -> Test Settings -> Default Processor Architecture -> X64
This solution was posted by #RehanSaeed here https://github.com/dotnet/cli/issues/3103
Sorry if this is not suitable place to post it.
I have completed my program and already build it. it has no problem running on my laptop but when i run on other laptop, there is an error appear
To run this application you must first install one of the following version of
.NET framework: v4.0.xxxxx
Contact your application publisher about obtaining the appropriate version of .Net framework
How do i check my program using which kind of .Net framework for running the program? can i just disable it?
You need to download and install the .Net Framework on your other laptop.
If you have an installation project, you can have this happen automatically when the application is installed on another computer.
I have downloaded and installed the Mono framework onto my Win7 development machine. I then followed the instructions here to have Visual Studio 2010 allow targeting of the Mono framework instead of .NET. I then create this test console app using VB with the target framwework set "Mono 2.10.8 profile" in the project's Advanced Compile Options:
Dim runningOnMono As Boolean = Not IsNothing(Type.GetType("Mono.Runtime"))
Console.WriteLine("Running on Mono = " & runningOnMono.ToString)
When I run this on the Win7 dev machine it returns False i.e. not running on Mono. When I run the program on a Linux machine that only has Mono installalled it returns True.
I can reference parts of the Mono framework in VS and intellisense works, but when I make this call:
Dim monoinf As New Mono.Unix.UnixDriveInfo("g:")
I get this exception:
===================================
FileNotFoundException was unhandled: Could not load file or assembly 'Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
===================================
Mono.Posix.dll version 4.0.0.0 does exist in many directories including the one created specifically for the VS Mono profile. I even tried copying it to the test app's directory.
Is it just that my mono install on the Win7 box is a mess? How can it be that intellisense works but the call to Type.GetType("Mono.Runtime") returns Nothing ?
The resaon I am trying to target Mono is because the class System.IO.DriveInfo does not work on Mono so I think I have to use Mono.Unix.UnixDriveInfo if I want to run on Windows and Linux. I need to get the free space of a USB flash drive.
Thanks for any help.
You already target Mono by following the blog post, but you should use mono.exe to launch your executable (test.exe as example) at Mono command prompt,
mono.exe test.exe
That's the only way Mono runtime is loaded instead of .NET Framework on Windows.