I'm having problems running MVC2. I've compiled defult MVC project and deployed it on working mono setup (MVC1 works without problems, but only as C#, VB.net MVC1 fails with a message similar to this one). When I try to access MVC2 web (VB.NET version, C# works) I get this message:
Compiler Error Message:
VBNC30456: 'RenderPartial' is not a member of 'System.Web.Mvc.HtmlHelper`1[[System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.
~/Views/Shared/Site.Master
I've set System.Web.MVC to Copy local, but to no avail.
# mono -V
Mono JIT compiler version 2.6.4 (tarball Tue May 25 19:27:01 CEST 2010)
Mono's VB compiler does not support 2008 features, like extension methods.
The way to get around this is to use Visual Studio to precompile your application and copy it to wherever you intend to use Mono to serve it. This way, Mono's VB compiler should never be invoked.
Related
I'm trying to run some NUnit tests written in Visual Studio on the command line using NUnit console. The tests are built using .NET 4.5.
To run them, I'm typing:
nunit3-console mytests.dll
And I keep getting a pop-up which tells me "an application on your PC needs the following Windows feature: .NET Framework 3.5 (includes .NET 2.0 and 3.0).
I've tried forcing NUnit to use 4.5 by saying
nunit3-console /framework:net-4.5 mytests.dll
But I get the same thing.
I tried installing .NET 3.5, but it can't be installed (I guess because I don't need it as I already have 4.5).
The tests run fine when run from Visual Studio using ReSharper or in the NUnit GUI...
I've created a really simple solution (tried with .NET 4 and .NET 4.5) which has a NuGet reference to NUnit 2.6.4 and one class (below):
[TestFixture]
public class Class1
{
[Test]
public void MyTest()
{
Assert.Pass();
}
}
I still get the same error.
How can I fix this?
That executable itself (nunit3-console) must have been produced by C# compiler to target .NET Framework 2.x/3.x (for the so called compatibility). Thus, when it runs on a pure .NET Framework 4.x Windows, you see the other compatibility feature by Microsoft, where it always prompts and asks to install .NET Framework 3.x (you must do that via Programs | Add/Remove Windows feature). Both of them are ridiculous as people should rarely use .NET Framework 2.x/3.x (though Microsoft will keep supporting .NET Framework 3.x as part of Windows).
To get rid of that prompt, you can enable .NET Framework 3.5 (which also gives you the bits to compile against .NET Framework 2.x/3.x). Or you modify its nunit3-console.exe.config file to use <supportedRuntime> to force .NET 4.x is used to load this executable.
I guess the NuGet version contains a proper .exe.config, while the MSI version not. You can analyze further for sure.
I have an existing .Net application that does some Word Interop work. On one machine where I have Word 2010 installed, I am able to reference the Word PIA (Microsoft.Office.Interop.Word) with no problem, compile, run - everything is great. Now, I'm trying to test against Word 2013 to ensure that my application is compatible with it. So on another machine with only Office 2013 installed (no other instances of Office), I try to build the same exact source code, but get compilation errors because VS2010 can't find the Word PIA. I tried updating the reference of the PIA, but it does not show up in the list of available assemblies.
I checked my installation of Office - every component available is installed, including .Net Programmability Support for Word. I looked at the GAC in Windows Explorer, and the assembly appears to be there. I tried restarting multiple times.
My application targets the .Net Framework 3.5 (but I also tried changing that to 4.0). I'm working in VS2010 Professional, and I have Office Professional Plus 2013 installed on the box. What could I be missing??
Thanks.
I am working on a system which scaffolds a migration from inside our code using ToolingFacade.
The system worked fine in entity framework 4.3.1. After the Upgrade to 5.0 I see that the correct entity framework version is loaded when starting out tool, however when I call the scaffold method I get the following exception:
Could not load type 'System.Data.Entity.Migrations.Design.ToolingFacade+ScaffoldRunner'
from assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'.
Does anyone know why calling a method in entity framework 5.0 requires an older version dll?
I ran into this issue recently when using EF6. Visual Studio required me to re-install EntityFramework via the Package Manage console to get things working again. Note that when I did so, the console output suggested that it had no idea that EF was installed before; somehow the association had been lost. Perhaps this is why the tooling assembly or assemblies weren't being loaded.
In any case, reinstalling the package via the console (and a restart of Visual Studio) solved the problem for me.
I am using VS2010 with SP1 (also have VS2012 installed on the same machine). Moles 1.0
The project is using .NET 4
I added moles assembly to system.dll and get the following error on compile
Error 46 The type or namespace name 'IReadOnlyList' does not exist in the namespace 'System.Collections.Generic' (are you missing an assembly reference?) [C:\Test\obj\Debug\Moles\s\m.g.csproj] C:\Test\m.g.cs Test
IReadOnlyList .NET 4.5 as far as I know.
Anyone else got this issue?
Updated Solution
I was able to get Pex to run in VS 2010 with .Net Framework 4.5 installed. Maybe others have explained that this is the solution but my issue (being new to Moles and Pex) is that many of the explanations were vague. Thanks to the author of these posts because they got me headed in the right direction:
http://feherzsolt.wordpress.com/2013/02/13/moles-and-net-4-5/
http://www.daedtech.com/using-moles-with-the-system-assembly
So the solution is to create a new .moles file (System.moles) in the test project at the same level that Pex created the yourAssemblyUnderTest.moles file and add the following to the file.
<Moles xmlns="http://schemas.microsoft.com/moles/2010/">
<Assembly Name="System" ReflectionOnly="true" />
</Moles>
You may have to clean (or manually delete the obj folder contents) and rebuild but this solution worked for me. I also noticed that the first build would report build errors, but the errors would go away on subsequent builds.
Alternative Solution
I know this isn't THE solution but it is a (poor) workaround that allows Pex to run...plus this was too long for a comment. If anyone knows how to get PEX to run on a machine with the 4.5 .Net Framework PLEASE respond.
This was my scenario. I have a machine with the .Net Framework 4.5 and I have Visual Studio 2010 and 2012 installed. I installed Pex (en_visual_studio_2010_pex_0.94.51023.0_power_tools_x64_598803.exe) and could run Pex in a VS 2010 project that was targeting .Net Framework 4.0. I could run Pex and it identified issues...but once I promoted issues to Unit Tests the unit test project wouldn't compile because of the following build error
The type or namespace name 'IReadOnlyList' does not exist in the namespace 'System.Collections.Generic' (are you missing an assembly reference?)
After much searching, and reading that Pex or Moles was replacing 4.5 .Net Framework assemblies with 4.0 versions I decided to uninstall 4.5, install 4.0, and give it a try. Running on 4.0 works just fine and I didn't need to define Mole type filters to get it to work. Then I tried tried to upgrade to the 4.5 Framework again...but sadly I end up right back where I started with the IReadOnlyList namespace issue.
I'm building an ASP.net application using Visual Studio Web Developer 2010 Express and have followed the Nerd Dinner tutorial for a large part. The problem is that when I try to build, it is constantly giving me a build error saying:
Error 43 Could not load file or
assembly 'System.Data.Entity,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system
cannot find the file specified.
This error is coming from the file "ASPNETCOMPILER" apparently. Some things that I have already checked are:
There is a reference to System.Data.Entity in the project references already.
I have .Net 4.0 installed on the system.
Any ideas on what could be wrong?
Try copying the System.Data.Entity.dll into your bin folder, or target your system to use .NET 2.0, as that should copy it over automatically.
Posting back for community goodness, the first comment in this thread by "DonSleza4e" seemed to solve my problem.