.net-assembly

The entity type Object is not part of the model for the current context

徘徊边缘 提交于 2019-12-08 14:32:23
问题 I'm creating an object in this way: var assembly = typeof (Cliente).Assembly; var Tipo = assembly.GetType("Datos." + tipoItem); var item = Activator.CreateInstance(Tipo); where tipoItem is the name of a class and Datos is the respective namespace. Cliente is a class in the same namespace. To store the object in the database I have this generic method: public void AddItem<TItem>(TItem item) where TItem : class { db.Set<TItem>().Add(item); db.SaveChanges(); } When debugging, the type of the

ASP.NET MVC4 doesn't load view in a different assembly

烈酒焚心 提交于 2019-12-08 13:51:30
I'm in the need of separating different project areas into separate assembies...I've got a problem resolving the view.. I've got the main project that's an mvc4 project with razor and StructureMap for IoC,I've created another MVC4 project where I've removed the config files and the App_Start foler...created a test class called AdminController under Controllers folder and under Views\Admin a file called Index.cshtml... AdminController.cs : public class AdminController : Controller { // // GET: /Admin/ public ActionResult Index() { return View(); } [...omiss...] } Index.cshtml : @{ ViewBag.Title

Is an assembly signed with a strong name before or after the post-build event?

偶尔善良 提交于 2019-12-08 12:42:16
问题 I'm modifying the stack size of an assembly using editbin , see Increase stack size of main program or create a new thread with larger stack size for recursive code blocks? Now I'm asking myself: Is an assembly signed with a strong name before or after the post-build event? Because editbin is changing the assembly in the post-build event. My post build-event looks like that: "$(DevEnvDir)..\..\VC\bin\editbin.exe" /STACK:16777216 "$(TargetPath)" And my project .csproj file contains the

No context type found in the assembly. ASP.NET MVC4

你离开我真会死。 提交于 2019-12-08 09:52:42
问题 Was following this tutorial here (wanted a database of customers instead of movies as per tutorial): http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table However when I attempt to run migrations commands the following error is encountered: "The context type 'MvcCustomer.Models.CustomerDbContext' was not found in the assembly 'MvcVault'." This is my customer model: using System; using System.Collections.Generic; using System

ASP.NET MVC4 doesn't load view in a different assembly

我怕爱的太早我们不能终老 提交于 2019-12-08 09:35:16
问题 I'm in the need of separating different project areas into separate assembies...I've got a problem resolving the view.. I've got the main project that's an mvc4 project with razor and StructureMap for IoC,I've created another MVC4 project where I've removed the config files and the App_Start foler...created a test class called AdminController under Controllers folder and under Views\Admin a file called Index.cshtml... AdminController.cs : public class AdminController : Controller { // // GET:

“Can't find the .NET assembly {AssemblyName} in specified folders”

岁酱吖の 提交于 2019-12-08 08:47:14
问题 I am simply trying to load sln files in to Visual NDepend and keep getting this error: Can't find the .NET assembly {AssemblyName} in specified folders. Has it been compiled properly? Is the NDepend project missing the containing folder of the .NET aseembly? The weirdest thing is that this error doesn't occur for the same assemblies under a different path. For example: The error won't occur in assemblies under the path C:\code\depot\Product\Stage\IA\ , and will occur under C:\code\depot

c# why can't I upcast to my plug-in's base class?

女生的网名这么多〃 提交于 2019-12-08 08:32:06
问题 I have a solution which creates DLLs and another one which consumes them. It is a Toolbox which can load various tools as plug-ins. At first things go well: These are the two classes, both in separate cs files: namespace PIClasses { public class PI_base : UserControl { public PI_base() { } public string Description { get; set; } public string Version { get; set; } private void InitializeComponent() { this.SuspendLayout(); this.Name = "PI_base"; this.ResumeLayout(false); } } } namespace

Dynamically load dll from android_assets folder

走远了吗. 提交于 2019-12-08 08:17:36
问题 is it possible to load an dll with Assembly.Load when it's in the asset folder? I have platform specific dll's for windows and android. I tried to use the android specific dll as asset (also in the build action), but when I try to load it into my app it's not found (I used the path: file:///android_asset/mydll.dll ), and this only happens, if i build the app as release, in debug i get the necessary paths to load the library, but not from the assets folder. What can I do? Is there another

How do I set assembly attributes (version, etc) in JScript.NET?

非 Y 不嫁゛ 提交于 2019-12-08 07:52:07
问题 I have some javascript that I'm compiling with Microsoft's jsc.exe compiler into a .NET assembly. I would like to set some assembly metadata, such as the file version, but it is unclear to me how to do that. How can I set these assembly-level attributes in JScript.NET? 回答1: import System.Reflection; [assembly: AssemblyCompanyAttribute("Your Company")] [assembly: AssemblyCopyrightAttribute("Copyright Your Company 2014")] [assembly: AssemblyDescriptionAttribute("Description")] [assembly:

Referencing a 3rd party assembly which is not located in the root location

自作多情 提交于 2019-12-08 07:44:59
问题 I have a Visual Studio 2010 C# project which creates an .exe and this project is using some 3rd party class library. My project is located in: /MyFramWork/tests/test1 3rd party library is located at: /MyFrameWork/bin/utils/ I am adding the reference to the library by using References->Add Reference->Browse. I can see that in the project file all is fine: ....\bin\utils\log4net.dll False I would like to reference the 3rd party library without using the option "Copy Local". However if I don't