小编Bis*_*hoy的帖子

除非安装了visual studio,否则无法使用C++/CLI DLL

介绍

我正在开发一种可以解释和使用API​​蓝图的工具.

我创建了一个新的控制台应用程序,添加了SnowCrash.NET nuget包并编写了这段代码:

    static void Main(string[] args)
    {
        snowcrashCLR.Blueprint blueprint;
        snowcrashCLR.Result result;

        var path = args.Length > 1 ? args[1] : @"c:\";

        snowcrashCLR.SnowCrashCLR.parse(path, out blueprint, out result);
        if (result != null)
        {
            var warnings = result.GetWarningsCs();
            foreach (var warning in warnings)
            {
                Console.WriteLine("{0}: {1}", warning.code, warning.message);
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

问题

当我将代码(复制bin文件夹)部署到与开发环境不同的计算机时,我收到指向SnowCrash.dll的FileNotFoundException

这是一个来自错误消息的snapshop:

无法加载文件或程序集"snowcrashCLR.DLL"或其依赖项之一.指定的模块无法找到.

细节:

[FileNotFoundException: Could not load file or assembly 'snowcrashCLR.DLL' or one of its dependencies. The specified module could not be found.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String …
Run Code Online (Sandbox Code Playgroud)

c# stl c++-cli visual-c++ snowcrash

8
推荐指数
1
解决办法
791
查看次数

如何在不更改数据库模型的情况下在Entity Framework中添加新的实体属性

我是Entity Framework的新手.我从数据库第一种方法开始,创建了与我选择的表对应的类.我在用MVC.我的一个表中有一Date列.我的要求是我想在我的gridview(网格MVC)中显示Day,即如果获取的特定记录的日期是10/27/2015,那么Day应该显示Tues.我想这样做,而不是在我的数据库中添加额外的列.有没有办法解决这个问题.任何帮助将不胜感激.

我生成的模型类如下: -

public partial class QnsNew1
    {
        public int Id { get; set; }
        public Nullable<System.DateTime> Date { get; set; }
        public Nullable<int> PersonelID { get; set; }
        public string CType { get; set; }
        public string Comments { get; set; }
        //public string Day { get; set; }//I want to avoid doing this
        public virtual Personnel Personnel { get; set; }
        public virtual Type Type { get; set; }
    }
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc entity-framework entity-framework-6

4
推荐指数
1
解决办法
1万
查看次数

开发ASP.NET WEB API服务应用程序

我将开发我的第一个ASP.NET WEB Api服务应用程序,但我不太确定如何开始.
如果我的数据库中有20个表,我是否必须创建20个Api控制器?

出于测试目的,我一直在为每个表创建一个api控制器.我不知道它是否是最好的方法,但它有效.我将使用工作单元模式和依赖注入(Unity for webapi).有人有任何想法或建议吗?

先感谢您.

c# asp.net rest web-services asp.net-web-api

2
推荐指数
1
解决办法
445
查看次数