visual studio2010引用64位.net4.0的问题 2C

在windows2008r2_64、windows10_64、windows2016_64用visual studio2010开发64位的项目,在项目引用里的目录是C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0,发现系统没有目录C:\Program Files\Reference Assemblies\Microsoft\Framework\v4.0,手动将引用目录指向C:\Windows\Microsoft.NET\Framework64\v4.0.30319出错。请问几个问题:
1、我要如何引用64位的.net4的DLL呢?
2、为什么没有C:\Program Files\Reference Assemblies\Microsoft\Framework\v4.0文件夹
3、我编译后的程序(爬虫,多线程)经常遇到莫名其妙的32位的dll0xc0000005错误,是否和64位置项目引用32位DLL引发的内存溢出有在windows2008r2_64、windows10_64、windows2016_64用visual studio2010开发64位的项目,在项目引用里的目录是C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0,发现系统没有目录C:\Program Files\Reference Assemblies\Microsoft\Framework\v4.0,手动将引用目录指向C:\Windows\Microsoft.NET\Framework64\v4.0.30319出错。请问几个问题:
1、我要如何引用64位的.net4的DLL呢?
2、为什么没有C:\Program Files\Reference Assemblies\Microsoft\Framework\v4.0文件夹
3、我编译后的程序(爬虫,多线程)经常遇到莫名其妙的32位的dll0xc0000005错误,是否和64位置项目引用32位DLL引发的内存溢出有关关
只要2个币了,对不住大家

1个回答

你把项目放在vs里有没有出错?先编译一下,如果不确定是32位还是64位,可以右键项目,选择Any CPU试试

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
VS引用Mysql 的Connector NET中的MySql Data dll有好几个,区别是
Mysql中选择引用Connector .NET中的MySql.Data.dll有v2.0、V4.0、V4.5的,用哪个好?这几个有什么区别?如果我是用VS2012的话用哪个,VS2010的话用哪个,VS2013的话用哪个??本人是接触mysql没多久不是很清楚,希望哪位大神解释清楚。谢谢。
C# WinForm DevComponents.DotNetBar2 别的电脑上运行报错
问题描述: C# WinForm程序用了第三方的控件DevComponents.DotNetBar2.dll,所用的DotNetBar2是破解的安装版。应用程序是Visual studio 2010上开发的,开发时本机能正常使用, 但是编译完成后,发到其他电脑上运行报错,错误截图如下: ![图片说明](https://img-ask.csdn.net/upload/201711/23/1511412943_971726.png) 点开【详细信息】如下: 有关调用实时(JIT)调试而不是此对话框的详细信息, 请参见此消息的结尾。 ************** 异常文本 ************** System.Runtime.InteropServices.COMException (0x80040154): 没有注册类 (异常来自 HRESULT:0x80040154 (REGDB_E_CLASSNOTREG)) 在 System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid) 在 System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid) 在 System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid) 在 System.Windows.Forms.AxHost.CreateInstance() 在 System.Windows.Forms.AxHost.GetOcxCreate() 在 System.Windows.Forms.AxHost.TransitionUpTo(Int32 state) 在 System.Windows.Forms.AxHost.CreateHandle() 在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 在 System.Windows.Forms.Control.CreateControl() 在 System.Windows.Forms.Control.OnVisibleChanged(EventArgs e) 在 System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e) 在 System.Windows.Forms.Control.SetVisibleCore(Boolean value) 在 DevComponents.DotNetBar.Metro.MetroTabPanel.set_Visible(Boolean value) 在 DevComponents.DotNetBar.Metro.MetroTabItem.?() 在 DevComponents.DotNetBar.Metro.MetroTabItem.set_Panel(MetroTabPanel value) 在 Courseware.MainForm.InitializeComponent() 位置 D:\workspace_vs2010\CoursewareNetImage\Courseware\MainForm.designer.cs:行号 391 在 Courseware.MainForm..ctor(LoginForm loginForm) 位置 D:\workspace_vs2010\CoursewareNetImage\Courseware\MainForm.cs:行号 35 在 Courseware.LoginForm.button1_Click(Object sender, EventArgs e) 位置 D:\workspace_vs2010\CoursewareNetImage\Courseware\LoginForm.cs:行号 513 在 System.Windows.Forms.Control.OnClick(EventArgs e) 在 System.Windows.Forms.Button.OnClick(EventArgs e) 在 System.Windows.Forms.Button.WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** 已加载的程序集 ************** mscorlib 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 (RTMRel.030319-0100) 基本代码: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll ---------------------------------------- Courseware 程序集版本: 1.0.0.0 Win32 版本: 1.0.0.0 基本代码: file:///E:/系统网络版无OFFICE新版/Courseware.exe ---------------------------------------- System.Windows.Forms 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 built by: RTMRel 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 built by: RTMRel 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 built by: RTMRel 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- log4net 程序集版本: 1.2.11.0 Win32 版本: 1.2.11.0 基本代码: file:///E:/系统网络版无OFFICE新版/log4net.DLL ---------------------------------------- System.Core 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 built by: RTMRel 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- System.Data.SQLite 程序集版本: 1.0.99.0 Win32 版本: 1.0.99.0 基本代码: file:///E:/系统网络版无OFFICE新版/System.Data.SQLite.DLL ---------------------------------------- System.Data 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 (RTMRel.030319-0100) 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- System.Xml 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 built by: RTMRel 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- System.Transactions 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 (RTMRel.030319-0100) 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll ---------------------------------------- DevComponents.DotNetBar2 程序集版本: 12.2.0.7 Win32 版本: 12.2.0.7 基本代码: file:///E:/系统网络版无OFFICE新版/DevComponents.DotNetBar2.DLL ---------------------------------------- System.Configuration 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 (RTMRel.030319-0100) 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.EnterpriseServices 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 (RTMRel.030319-0100) 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll ---------------------------------------- System.Numerics 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 built by: RTMRel 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll ---------------------------------------- AxInterop.APlayer3Lib 程序集版本: 1.0.0.0 Win32 版本: 1.0.0.0 基本代码: file:///E:/系统网络版无OFFICE新版/AxInterop.APlayer3Lib.DLL ---------------------------------------- mscorlib.resources 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 (RTMRel.030319-0100) 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/mscorlib.resources.dll ---------------------------------------- System.Windows.Forms.resources 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 built by: RTMRel 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.Windows.Forms.resources.dll ---------------------------------------- Accessibility 程序集版本: 4.0.0.0 Win32 版本: 4.0.30319.1 built by: RTMRel 基本代码: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll ---------------------------------------- ************** JIT 调试 ************** 要启用实时(JIT)调试, 该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置 jitDebugging 值。 编译应用程序时还必须启用 调试。 例如: <configuration> <system.windows.forms jitDebugging="true" /> </configuration> 启用 JIT 调试后,任何未经处理的异常 都将被发送到在此计算机上注册的 JIT 调试器, 而不是由此对话框处理。 我经过分析,发现DevComponents.DotNetBar2.dll在开发电脑上已经写入了注册表,应该是注册到了全局程序集GAC,如下图: ![图片说明](https://img-ask.csdn.net/upload/201711/23/1511413357_66205.png) 通过查找应用程序中代码{DevComponents.DotNetBar.Metro.MetroShell metroShell1;}的类的定义,也应验了实际上我的程序里使用的DevComponents.DotNetBar的类都是来自于GAC,如下图所示: ![图片说明](https://img-ask.csdn.net/upload/201711/23/1511413429_346565.png) 我现在的疑问是:C#项目根目录下已经存放了一个DevComponents.DotNetBar2.dll文件,并且已添加了此dll文件的引用(见下图),为什么程序最终使用的DevComponents.DotNetBar2.dll却是来自GAC而不是项目引入的dll,如何在C#项目中改变dll的程序集指向,不要用GAC的程序集?(因为使用这个应用程序的电脑不可能安装GAC全局程序集) ![图片说明](https://img-ask.csdn.net/upload/201711/23/1511414544_396136.png) P.S. 网上查了各种资料,有的说是使用.net framework 4.0及项目的setup属性改成x86,这些设置我都已查验过,开发电脑上设置都是对的,非开发用的电脑上也确认安装的是.net framework 4.0。
Asp.net mvc 单元测试中调用控制器方法返回数据的Model属性
最近在自学asp.net mvc 参考的书籍是Adam Freeman的Pro Asp.Net Mvc5 其中在一个演示项目的单元测试中遇到了问题。代码如下: ``` using System; using System.Linq; using System.Collections; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using System.Web.Mvc; using SportsStore.Domain.Abstract; using SportsStore.Domain.Entities; using SportsStore.WebUI.Controllers; using System.Collections.Generic; namespace SportsStore.UnitTests { [TestClass] public class UnitTest1 { [TestMethod] public void Can_Pagenate() { //准备 Mock<IProductRepository> mock = new Mock<IProductRepository>(); mock.Setup(m=>m.Products).Returns(new Product[]{ new Product{ProductID = 1,Name="P1"}, new Product{ProductID = 2,Name="P2"}, new Product{ProductID = 3,Name="P3"}, new Product{ProductID = 4,Name="P4"}, new Product{ProductID = 5,Name="P5"}, }); ProductController controller = new ProductController(mock.Object); controller.PageSize = 3; //动作 IEnumerable<Product> result = (IEnumerable<Product>)controller.List(2).Model; //断言 Product[] prodArray = result.ToArray(); Assert.IsTrue(prodArray.Length == 2); Assert.AreEqual(prodArray[0].Name, "P4"); Assert.AreEqual(prodArray[1].Name,"P5"); } } } ``` 在以下代码初出现错误: IEnumerable<Product> result = (IEnumerable<Product>)controller.List(2).Model; 提示:“System.Web.Mvc.ActionResult”不包含Model的定义,并且找不到可接受类型为"System.Web.Mvc.ActionResult"的第一个参数的扩展方法"Model"(是否缺少using指令或程序集引用?) 疑惑如下: 该单元测试的这里的思想是,将控制器方法返回的数据进行获取,在结果上调用Model属性。这里调用失败了。但是为什么失败呢 这里还有另一个错误 提示:程序集“SportsStore.WebUI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”所使用的“System.Web.Mvc, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”版本高于所引用的程序集“System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”的版本 是否与此相关,又该如何解决呢 另外还有几个错误如下: 错误 3 类型“System.Web.IHttpModule”在未被引用的程序集中定义。必须添加对程序集“System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”的引用。 G:\项目\SportsStore\SportsStore.UnitTests\App_Start\NinjectWebCommon.cs 23 13 错误 5 未能找到类型或命名空间名称“IHttpModule”(是否缺少 using 指令或程序集引用?) G:\项目\SportsStore\SportsStore.UnitTests\App_Start\NinjectWebCommon.cs 44 25 NinjectWebCommon.cs ``` [assembly: WebActivator.PreApplicationStartMethod(typeof(SportsStore.UnitTests.App_Start.NinjectWebCommon), "Start")] [assembly: WebActivator.ApplicationShutdownMethodAttribute(typeof(SportsStore.UnitTests.App_Start.NinjectWebCommon), "Stop")] namespace SportsStore.UnitTests.App_Start { using System; using System.Web; using Microsoft.Web.Infrastructure.DynamicModuleHelper; using Ninject; using Ninject.Web.Common; public static class NinjectWebCommon { private static readonly Bootstrapper bootstrapper = new Bootstrapper(); /// <summary> /// Starts the application /// </summary> public static void Start() { DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule)); DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule)); bootstrapper.Initialize(CreateKernel); } /// <summary> /// Stops the application. /// </summary> public static void Stop() { bootstrapper.ShutDown(); } /// <summary> /// Creates the kernel that will manage your application. /// </summary> /// <returns>The created kernel.</returns> private static IKernel CreateKernel() { var kernel = new StandardKernel(); kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel); kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>(); RegisterServices(kernel); return kernel; } /// <summary> /// Load your modules or register your services here! /// </summary> /// <param name="kernel">The kernel.</param> private static void RegisterServices(IKernel kernel) { } } } ``` 这里使用的软件是Visual Studio 2013
【求助笔试题]】 找出VB.NET写的21点扑克牌程序中的问题
遇到一个面试题,题目要求是这样的 写了一个21点扑克牌的程序,用VB.NET写的,需要你找出其中的bugs,尽可能多 的找出,并写明错误原因 由于小弟写C#的,对VB.NET实在不熟悉,还希望有经验前辈帮忙看看 小弟不胜感觉 代码一共有6个类 分别是 Blackjack Card Deck Game Hand Player ProbabilityCalculator 代码文件如下 ``` ''' <summary> ''' Emulates a black jack game between two different AI players. 模拟两个不同的AI玩家之间的黑杰克游戏。 ''' </summary> Public Class Blackjack Public Shared ReadOnly AllCards As New List(Of Card) ''' <summary> ''' Static constructor. ''' Generates a list containing one of every possible card.生成一个包含所有可能卡片的列表 ''' This simplified game assumes a single deck of 52 cards, one of every unique suit and rank combination. ''' 这个简化的游戏假设有一副52张的牌,每副牌都有自己独特的花色和等级组合。 ''' </summary> Shared Sub New() For Each s As Card.Suit In [Enum].GetValues(GetType(Card.Suit)) For Each r As Card.Rank In [Enum].GetValues(GetType(Card.Rank)) AllCards.Add(New Card(r, s)) Next Next End Sub ''' <summary> ''' Main method. Constructs the object, plays the game, prints the output. ''' Don't change this method! ''' </summary> ''' <param name="args">Command line args, unused.</param> Public Shared Sub Main(args As String()) Dim deck As New Deck(AllCards) Dim random As New Random() Dim calculator As New ProbabilityCalculator(AllCards) Dim player1 As New Player("Harry", calculator) Dim player2 As New Player("Joe", calculator) Dim game As New Game(deck, random, player1, player2) Console.WriteLine(game.Play()) Console.ReadLine() End Sub End Class ``` Imports System Imports System.Collections.Generic Imports System.Text ''' <summary> ''' Represents a single playing card, the combination of a suit (Spades, hearts, clubs, diamonds) ''' and a rank (Ace, two, three... Jack, Queen, King). ''' 表示一张纸牌,是花色(黑桃、红心、梅花、方块)的组合 ''' 还有一排(a,二,三……杰克,王后,国王)。 ''' Any particular card is worth a number of points, according to its rank. ''' 任何一张特定的纸牌,根据它的等级,值若干点数。 ''' In this simplified game, an Ace is always worth 1 points. ''' A two is with 2 points, three worth 3, and so on. ''' The face cards (Jack, Queen, King) are worth 10 points. ''' 在这个简化的游戏中,a总是值1分 '''2是2分,3是3分,以此类推 '''脸牌(杰克、皇后、国王)值10分。 ''' </summary> Public Class Card Public Enum Suit Spades Hearts Clubs Diamonds End Enum Public Enum Rank Ace = 1 Two = 2 Three = 3 Four = 4 Five = 5 Seven = 7 Eight = 8 Nine = 9 Ten = 10 Jack = 11 Queen = 12 King = 13 End Enum ReadOnly mSuit As Suit ReadOnly mRank As Rank Public Sub New(r As Rank, s As Suit) mSuit = s mRank = r End Sub ''' <summary> ''' Returns a human readable name of the card, for example "Ace of Spades", suitable for inclusion in ''' the game's console output. ''' 返回人类可读的纸牌名称,例如“黑桃a”,适合包含在游戏控制台输出中 ''' </summary> ''' <returns>Name of the card</returns> Public ReadOnly Property Description As String Get ' Return mRank + " of" + mSuit Return mRank.ToString + " of" + mSuit.ToString End Get End Property ''' <summary> ''' Returns the number of points that this card is worth, according to its rank. ''' 返回该牌值多少分,根据其分值。 ''' </summary> ''' <returns>Point value of this card.</returns> Public ReadOnly Property Points As Integer Get Return CType(mRank, Integer) End Get End Property Public Overrides Function ToString() As String Return Description End Function End Class `` ''' <summary> ''' Represents a collection of playing cards that will be dealt in the game. ''' 表示将在游戏中处理的纸牌集合。 ''' A fresh deck usually begins with the cards in an ordered sequence according to their suit and rank. ''' 一副新牌通常是按照牌的花色和等级顺序排列的。 ''' Before dealing cards to the players, the dealer should shuffle the deck, <see cref="System.Random" /> ''' 发牌前,发牌人应洗牌 ''' otherwise cards will be dealt in their original sequence. ''' 否则,牌将按原来顺序处理 ''' During the game, the dealer deals one card at a time, removing it from the top ''' of the deck, and adding it to the player's hand. ''' 在游戏中,发牌人一次发一张牌,把它从牌顶移开 并将其添加到玩家手上。 ''' </summary> ''' <remarks></remarks> Public Class Deck ''' <summary> ''' The cards remaining to be dealt ''' 剩下要处理的牌集合 ''' </summary> Private mCards As List(Of Card) ''' <summary> ''' Constructs a fresh deck with the specified cards in the given sequence ''' 按照给定的顺序用指定的牌组构造新的牌组 ''' </summary> ''' <param name="cards">@param cards cards</param> Public Sub New(cards As List(Of Card)) mCards = cards End Sub ''' <summary> ''' Randomizes the sequence of the cards within the deck. ''' 将牌堆中的牌的顺序随机化 ''' </summary> Public Sub Shuffle(random As Random) ' Keep a reference to the existing cards, then build a new list and copy ' 保持对现有卡片的引用,然后建立一个新的列表并复制 ' the cards over in a random sequence. ' 这些卡片是随机排列的。 Dim originalCards As List(Of Card) = mCards Dim shuffledCards As New List(Of Card) Dim numberOfCards As Integer = originalCards.Count For i As Integer = 0 To numberOfCards Dim nextCardIndex As Integer = random.Next(originalCards.Count) Dim nextCard As Card = originalCards(nextCardIndex) shuffledCards.Add(nextCard) Next mCards = shuffledCards End Sub ''' <summary> ''' Draws a card from the top of the deck, so that it can be added to a player's hand. ''' 从牌堆顶部抽一张牌,这样它就可以加到玩家手上。 ''' </summary> ''' <returns>Dealt card</returns> Public Function Deal() As Card Return mCards(0) End Function ''' <summary> ''' Returns the list of cards in the deck, in the sequence that they are going to be dealt. ''' 返回牌堆中纸牌的列表,按将要处理它们的顺序排列。 ''' </summary> ''' <returns>Cards cards in the deck</returns> Public ReadOnly Property Cards As List(Of Card) Get Return mCards End Get End Property End Class ``` ''' <summary> ''' Controller responsible for overall game loop. ''' 负责整个游戏循环的控制器 ''' </summary> Public Class Game Private mDeck As Deck Private mRandom As Random Private mPlayer1 As Player Private mPlayer2 As Player Public Sub New(deck As Deck, random As Random, player1 As Player, player2 As Player) mDeck = deck mRandom = random mPlayer1 = player1 mPlayer2 = player2 End Sub Public ReadOnly Property Deck As Deck Get Return mDeck End Get End Property Public ReadOnly Property Random As Random Get Return mRandom End Get End Property Public ReadOnly Property Player1 As Player Get Return mPlayer1 End Get End Property Public ReadOnly Property Player2 As Player Get Return mPlayer2 End Get End Property ''' <summary> ''' Main control loop. You an imagine this routine to reflect the actions of the dealer, who ''' coordinates gameplay. ''' 主要控制回路。你可以想象这个程序反映了协调游戏玩法的商人的行动。 ''' This simple game is played by two players. ''' The dealer is given a single fresh deck of cards, which he then shuffles. ''' Each player is dealt two cards. ''' Then each player takes their turn. ''' During their turn, a player can choose to "hit", which means they want to be dealt another card, ''' or to "stand", which means they will end their turn. ''' The player may "hit" as many times as they wish before ending their turn. ''' Once both players have taken their turn, the winner is determined. ''' The winner is the player with the greatest number of points without exceeding 21. ''' 这个简单的游戏是两个玩家玩的。发牌人拿到一副新的牌,然后洗牌。每人发两张牌。然后每个玩家轮流上场 '''在他们的回合中,玩家可以选择“hit”,这意味着他们想要发另一张牌,或者选择“stand”,这意味着他们将束他们的回合。 '''玩家可以在回合结束前按自己的意愿“命中”多少次。一旦两名选手轮流上场,胜者就已确定。得分最多且不超过21分者为胜者。 ''' </summary> ''' <returns>Output from the game</returns> Public Function Play() As String Dim output As New StringBuilder() ' The game begins... Dim hand1 = New Hand(mPlayer1) hand1.AddCard(mDeck.Deal()) hand1.AddCard(mDeck.Deal()) Dim hand2 = New Hand(mPlayer2) hand1.AddCard(mDeck.Deal()) hand1.AddCard(mDeck.Deal()) output.AppendFormat("{0} starts with {1}{2}", hand1.Player.Name, hand1.Description, Environment.NewLine) output.AppendFormat("{0} starts with {1}{2}", hand2.Player.Name, hand2.Description, Environment.NewLine) ' Players take their turns Dim hands As New List(Of Hand)({hand1, hand2}) For Each hand As Hand In hands Dim name As String = hand.Player.Name output.AppendFormat("{0}'s turn...{1}", name, Environment.NewLine) While (hand.Player.WantsToHit(hand.TotalPoints)) Dim dealt As Card = mDeck.Deal() output.AppendFormat("{0} hits: {1}{2}", name, dealt.Description, Environment.NewLine) hand.AddCard(dealt) End While If hand.TotalPoints > 21 Then output.AppendFormat("{0} bursts.{1}", name, Environment.NewLine) Else output.AppendFormat("{0} stands.{1}", name, Environment.NewLine) End If Next ' Determine the winner If hand1.Beats(hand2) Then output.AppendFormat("{0} WINS!{1}", hand1.Player.Name, Environment.NewLine) ElseIf hand2.Beats(hand1) Then output.AppendFormat("{0} WINS!{1}", hand2.Player.Name, Environment.NewLine) Else output.AppendFormat("It's a DRAW!{0}", Environment.NewLine) End If Return output.ToString() End Function End Class ``` ''' <summary> ''' Represents the collection of cards that have been dealt to a player. ''' 表示已分发给玩家的纸牌集合 ''' </summary> Public Class Hand ''' <summary> ''' The cards currently held in this hand ''' </summary> Private mCards As List(Of Card) ''' <summary> ''' The player to whom this hand belongs ''' </summary> Private mPlayer As Player ''' <summary> ''' Constructs a new hand for the specified player. ''' </summary> ''' <param name="player">The player to whom this hand belongs</param> Public Sub New(player As Player) mPlayer = player mCards = New List(Of Card)() End Sub ''' <summary> ''' Returns the player that this hand belongs to. ''' </summary> ''' <returns>player</returns> Public ReadOnly Property Player As Player Get Return mPlayer End Get End Property ''' <summary> ''' Adds a card to the hand ''' </summary> ''' <param name="card">the card to be added</param> Public Sub AddCard(card As Card) mCards.Add(card) End Sub ''' <summary> ''' Returns the total points for this hand by adding up the points of each card. ''' </summary> ''' <returns>total points</returns> Public ReadOnly Property TotalPoints As Integer Get Dim points As Integer = 0 For i As Integer = 0 To (mCards.Count - 1) points += mCards(i).Points Next Return points End Get End Property ''' <summary> ''' Determines whether this hand is better than the other player's hand. ''' 确定这手牌是否比其他玩家的那手牌好 ''' In general, the winning hand is the hand with the greatest number of points. ''' 一般来说,获胜的手是得分最多的手 ''' But, if the hand exceeds 21 then it is a "bust" - the other player wins. ''' 但是,如果这只手超过21,那么它就是一个“半身像”——另一个玩家赢了 ''' If both players bust, or if their total points are the same, then it is a draw. ''' 如果双方球员都失败了,或者他们的总得分相同,那么就是平局 ''' </summary> ''' <param name="other">the hand to compare against</param> ''' <returns>True, if this is a better hand than the specified other hand</returns> Public Function Beats(other As Hand) As Boolean Dim myScore As Integer = TotalPoints If myScore > 21 Then Return False End If Dim otherScore As Integer = other.TotalPoints If otherScore > myScore Then Return False End If Return True End Function ''' <summary> ''' Returns a formatted description of the cards in the hand, suitable for screen output ''' </summary> ''' <returns>Description of the hand</returns> Public ReadOnly Property Description As String Get Dim desc As New StringBuilder() desc.Append(mCards.Count) desc.Append(" cards: ") Dim first As Boolean = True For Each card As Card In mCards If Not first Then desc.Append(", ") End If desc.Append(card.Description) first = False Next desc.Append(".") Return desc.ToString() End Get End Property End Class ``` ''' <summary> ''' Represents a player, and their decision making logic for whether to ''' "hit" or "stand" ''' </summary> Public Class Player ''' <summary> ''' A friendly name that identifies the player. ''' 一个识别玩家的友好名字 ''' </summary> Private mName As String ''' <summary> ''' Used for calculating probability of bust ''' 用于计算破产概率 ''' </summary> Private mProbabilityCalculator As ProbabilityCalculator ''' <summary> ''' Constructor. ''' </summary> ''' <param name="name">player's name</param> ''' <param name="probabilityCalculator">for calculating probability of bust</param> ''' <remarks></remarks> Public Sub New(name As String, probabilityCalculator As ProbabilityCalculator) mName = name mProbabilityCalculator = probabilityCalculator End Sub ''' <summary> ''' Returns the player's name ''' </summary> ''' <returns>name</returns> Public ReadOnly Property Name As String Get Return mName End Get End Property ''' <summary> ''' Determines whether the player would like to "hit" (have another card dealt to their hand), ''' or "stand" (end their turn). ''' In this simple implementation, the player's strategy is to hit, so long as they are more likely ''' to increase their points than they are to bust. ''' If their current points are at 21, they should always stay ''' If their current points are at 10 or below, they can never bust, so they should always hit ''' For points in between, they will hit so long as the probability of the next draw causing a bust is less ''' than 50%. ''' 决定玩家是想“击中”(手上有另一张牌),还是“站着”(结束他们的回合)。在这个简单的实现中,玩家的策略是命中, ''' 只要他们更有可能增加他们的点数而不是失败。如果他们现在的分数是21分,他们应该一直保持下去 '''如果他们现在的点数是10点或以下,他们永远不会破产,所以他们应该总是击中中间的点数,只要下一次平局导致破产的概率小于50%,他们就会击中。 ''' </summary> ''' <param name="currentPoints">The total of the cards currently held by this player</param> ''' <remarks>True if the players wants to "hit", false if they want to "stand".</remarks> Public Function WantsToHit(currentPoints As Integer) If currentPoints >= 21 Then Return False ElseIf currentPoints <= 10 Then Return True Else Return mProbabilityCalculator.CalculateProbability(currentPoints) < 0.5 End If End Function End Class ``` ''' <summary> ''' Used by the player's hit/stand decision making, to determine the probability of busting if ''' they deal another card. ''' 用于玩家的命中/立场决策,以确定如果他们发另一张牌失败的概率 ''' </summary> Public Class ProbabilityCalculator ''' <summary> ''' All possible cards ''' </summary> Private mFullDeck As List(Of Card) Public Sub New(fullDeck As List(Of Card)) mFullDeck = fullDeck End Sub ''' <summary> ''' Determines the probability of a "bust" if the players deals one more card into their hand. ''' A "bust" occurs if the next card takes their total over 21. ''' 确定一个“破产”的概率,如果玩家在他们的手上多出一张牌。如果下一张牌的总数超过21,就会发生“破产” ''' ''' The probability is simulated as follows: ''' Consider all possible cards that might be dealt next if the player chooses to "hit". ''' (Since "card counting" is a no-no in Blackjack, we imagine that *any* of the cards from a ''' normal full deck could be dealt next. ie. don't exclude cards that have already been dealt). ''' For each possibility, determine the total points that would be achieved if that card ''' were added to the player's hand, and decide whether or not it is a bust. ''' The probability of a bust is the percentage of all the combinations tried that resulted in a bust. ''' 概率模拟如下: 考虑一下,如果玩家选择“命中”,接下来可能要发的所有牌。 '''(由于“数牌”在21点游戏中是不允许的,我们认为接下来可以处理任何一张普通的整副牌中的牌。ie。不要排除已经发过的牌)。 '''对于每一种可能性,确定如果那张牌可以获得的总积分 被添加到玩家手上,并决定它是否是一个破产。 '''破产的概率是所有尝试过的导致破产的组合的百分比。 ''' ''' For example, if the player's current total is 12, then dealing any card worth 10 points ''' will result in a bust. Out of the 52 cards in a deck, 16 of them are worth 10 points (the Tens, Jacks, ''' Queens and Kings of Spades, Hearts, Clubs and Diamonds). So, the probability of a bust ''' is 0.3077 (30.77%), which is 16 divided by 52. ''' Similarly, if the player's current total is 19, there are 44 possible cards that will result in ''' a bust (everything except the aces and twos), and so the probability is 0.8462. ''' 例如,如果玩家当前的总数是12,那么处理任何值10分的牌 会导致破产。在一副牌中的52张牌中,16张值10分(10,j,黑桃、红桃、梅花和方块的王后和国王)。 ''' 因此,破产的概率是0.3077(30.77%)也就是16除以52。同样的,如果玩家当前的总数是19,那么有44张可能导致失败的牌(除了a和2以外的所有牌),所以概率是0.8462。 ''' </summary> ''' <param name="currentPoints">the total points for the player's current hand</param> ''' <returns>probability of a bust if one more card is dealt (0.5f = 50%)</returns> Public Function CalculateProbability(currentPoints As Integer) As Decimal ' Problem: we can't calculate the probability if we don't have any cards to simulate with. ' This shouldn't happen, but to prevent potential crashes, we'll return 50% ' 问题:如果我们没有卡片来模拟,我们就无法计算概率。这不应该发生,但为了防止潜在的崩溃,我们将返回50% If mFullDeck.Count = 0 Then Return 0.5 End If Dim numberOfBusts As Integer = 0 Dim numberOfNonBusts As Integer = 0 For Each card As Card In mFullDeck Dim potentialPoints = currentPoints + card.Points If (potentialPoints > 21) Then numberOfBusts += 1 Else numberOfNonBusts += 1 End If Next Return numberOfBusts / CType(numberOfNonBusts, Decimal) End Function End Class ``` ``` ```
visual stidio C++2010
我用的是VC++2010版的,先建了一个工程,用多文件组织写的,我的程序是这样的: //头文件:fun.h #include<iostream> using namespace std; template <class T1,class T2> class MyClass { private : T1 a; T2 b; public: MyClass(T1 t1,T2 t2); void show(); }; //fun.cpp #include<iostream> using namespace std; template <class T1,class T2> class MyClass { private : T1 a; T2 b; public: MyClass(T1 t1,T2 t2); void show(); }; //main.cpp #include<iostream> using namespace std; template <class T1,class T2> class MyClass { private : T1 a; T2 b; public: MyClass(T1 t1,T2 t2); void show(); }; 结果程序运行的时候出现这样的错误: 1>------ 已启动生成: 项目: template.ERROR, 配置: Debug Win32 ------ 1>main.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall MyClass<double,char>::show(void)" (?show@?$MyClass@ND@@QAEXXZ),该符号在函数 _main 中被引用 1>main.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall MyClass<double,char>::MyClass<double,char>(double,char)" (??0?$MyClass@ND@@QAE@ND@Z),该符号在函数 _main 中被引用 1>main.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall MyClass<int,float>::show(void)" (?show@?$MyClass@HM@@QAEXXZ),该符号在函数 _main 中被引用 1>main.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall MyClass<int,float>::MyClass<int,float>(int,float)" (??0?$MyClass@HM@@QAE@HM@Z),该符号在函数 _main 中被引用 1>C:\Users\TEST\Documents\Visual Studio 2010\Projects\template\Debug\template.ERROR.exe : fatal error LNK1120: 4 个无法解析的外部命令 ========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ========== 有请为大神帮帮忙,讲不胜感激,这个问题困扰了好几天了都,
vs2013创建的framework4.0项目在nuget.org里添加autofac报错
添加时 版本号显示的是4.6.1,引用报错。 首先,开始我的项目是framework4.5的,但后来知道对方系统是win2003的不支持4.5 ,只好降版本,网查了资料后,发现要重新建立4.0的项目 ,把原来的dll文件版本也要是4.0的才行,就重新添加引用了,但遇到autofac版本之前是4.5的,于是删除,重新在nuget.org里引用,默认版本是4.6.1的,导致引用时失败回滚,怎么解决?
LNK2019 无法解析的外部符号 找不出错误,求大神指导
///zero.h namespace SALES { const int QUARTERS = 4; struct Sales { double sales[QUARTERS]; double average; double max; double min; }; void setSales(Sales &s, const double ar[], int n); void setSales(Sales &s); void showSales(const Sales &s); } ////1.cpp #include<iostream> #include"zero.h" using namespace SALES; void setSales(Sales &s, const double ar[], int n) { double Ave, Max = ar[0], Min = ar[0], Sum = 0; int i; for (i = 0; ar[i]!='\0'; i++) s.sales[i] = ar[i]; while (3 - i > 0) { s.sales[i + 1] = 0; i++; } for (int i = 0; ar[i] != '\0'; i++) if (s.sales[i] > Max) Max = s.sales[i]; for (int i = 0; ar[i] != '\0'; i++) if (s.sales[i] < Min) Min = s.sales[i]; for (int i = 0; ar[i] != '\0'; i++) Sum += s.sales[i]; Ave = Sum / 4; } void setSales(Sales &s) { for (int i = 0; i < 4; i++) { using std::cout; using std::cin; using std::endl; cout << "Enter " << i + 1 << " Sales: "; cin >> s.sales[i]; } double Ave, Max = s.sales[0], Min = s.sales[0], Sum = 0; for (int i = 0;i<4; i++) if (s.sales[i] > Max) Max = s.sales[i]; for (int i = 0;i<4; i++) if (s.sales[i] < Min) Min = s.sales[i]; for (int i = 0;i<4; i++) Sum += s.sales[i]; Ave = Sum / 4; } void showSales(const Sales &s) { using std::cout; using std::endl; cout << "****************************" << endl; for (int i = 0; s.sales[i] != '\0'; i++) cout << i + 1 << " average: " << s.average << " min: " << s.min << " max: " << s.max << endl; } ///2/cpp #include<iostream> #include"zero.h" using namespace SALES; int main() { double ou[3] = {1,3,5}; Sales dd; setSales(dd,ou,3); showSales(dd); setSales(dd); showSales(dd); system("pause"); return 0; } 严重性 代码 说明 项目 文件 行 禁止显示状态 错误 LNK2019 无法解析的外部符号 "void __cdecl SALES::setSales(struct SALES::Sales &)" (?setSales@SALES@@YAXAAUSales@1@@Z),该符号在函数 _main 中被引用 ConsoleApplication24 c:\Users\admin\documents\visual studio 2015\Projects\ConsoleApplication24\ConsoleApplication24\2.obj 1 严重性 代码 说明 项目 文件 行 禁止显示状态 错误 LNK2019 无法解析的外部符号 "void __cdecl SALES::setSales(struct SALES::Sales &,double const * const,int)" (?setSales@SALES@@YAXAAUSales@1@QBNH@Z),该符号在函数 _main 中被引用 ConsoleApplication24 c:\Users\admin\documents\visual studio 2015\Projects\ConsoleApplication24\ConsoleApplication24\2.obj 1 严重性 代码 说明 项目 文件 行 禁止显示状态 错误 LNK2019 无法解析的外部符号 "void __cdecl SALES::showSales(struct SALES::Sales const &)" (?showSales@SALES@@YAXABUSales@1@@Z),该符号在函数 _main 中被引用 ConsoleApplication24 c:\Users\admin\documents\visual studio 2015\Projects\ConsoleApplication24\ConsoleApplication24\2.obj 1
64位程序 汇编 时的调用约定问题? [问题点数:100分]
64位程序已经抛弃了_stdcall, 等, 这个OK 但是在使用 ml64 进行汇编时, 似乎仍然使用的是stdcall; 如下: ``` // .asm .CODE Int_3 proc a:DWORD,b:DWORD,c:DWORD,d:DWORD mov ebx,a mov rax, 12345h ret Int_3 ENDP END ; 文件结束 // .asm 编译输出 000000013F051020 push rbp 000000013F051021 mov rbp,rsp 000000013F051024 mov ebx,dword ptr [rbp+10h] // 为什么调用以ecx传递, 而内部仍然用栈? 000000013F051027 mov rax,12345h 000000013F05102E leave 000000013F05102F ret // .cpp extern"C" void __stdcall Int_3(unsigned long a, long b, long c); int _tmain(int argc, _TCHAR* argv[]) { Int_3(10, 15, 16); return 0; } // .cpp 编译输出(部分) Int_3(10, 15, 16); 000000013F051061 mov r8d,10h 000000013F051067 mov edx,0Fh 000000013F05106C mov ecx,0Ah 000000013F051071 call @ILT+5(Int_3) (13F05100Ah) ``` 问题有: 1: 引用声明为3个参数, 而汇编原型为4个参数, 这样竟然也可通过? 2: 64位调用采用了64位的调用法(_fastcall?),而汇编子程序对参数的使用仍然为_stdcall模式? 请教如何解决, 谢谢! ps: 开发环境为vs c++
软件登录时提示System.NullReferenceException未被引用到实例
![图片说明](https://img-ask.csdn.net/upload/201904/19/1555644735_976122.png) 测试了很多电脑大部分可以登录,个别电脑登录时提示这个错误,重新装了NET插件和Access数据库还是不行,本人完全菜鸟一枚求大神帮帮忙啊,解决不了急死了~~~~ ee the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** ee the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at Emergency.Module.setControls(Single newx, Single newy, Control cons) in d:\Users\Desktop\站务中心应急辅助系统测试版\Emergency\Class\Module.cs:line 2944 at Emergency.FormMain.FormMain_Resize(Object sender, EventArgs e) in d:\Users\Desktop\站务中心应急辅助系统测试版\Emergency\DataForm\FormMain.cs:line 49 at System.Windows.Forms.Control.OnResize(EventArgs e) at System.Windows.Forms.Form.OnResize(EventArgs e) at System.Windows.Forms.Control.OnSizeChanged(EventArgs e) at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight) at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height) at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified) at System.Windows.Forms.Form.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified) at System.Windows.Forms.Control.ScaleControl(SizeF factor, BoundsSpecified specified) at System.Windows.Forms.ScrollableControl.ScaleControl(SizeF factor, BoundsSpecified specified) at System.Windows.Forms.Form.ScaleControl(SizeF factor, BoundsSpecified specified) at System.Windows.Forms.Control.ScaleControl(SizeF includedFactor, SizeF excludedFactor, Control requestingControl) at System.Windows.Forms.ContainerControl.Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl) at System.Windows.Forms.ContainerControl.PerformAutoScale(Boolean includedBounds, Boolean excludedBounds) at System.Windows.Forms.ContainerControl.PerformNeededAutoScaleOnLayout() at System.Windows.Forms.ContainerControl.OnLayoutResuming(Boolean performLayout) at System.Windows.Forms.Control.ResumeLayout(Boolean performLayout) at Emergency.FormMain.InitializeComponent() in d:\Users\Desktop\站务中心应急辅助系统测试版\Emergency\DataForm\FormMain.Designer.cs:line 2355 at Emergency.FormMain..ctor() in d:\Users\Desktop\站务中心应急辅助系统测试版\Emergency\DataForm\FormMain.cs:line 17 at Emergency.FormLogin.button1_Click(Object sender, EventArgs e) in d:\Users\Desktop\站务中心应急辅助系统测试版\Emergency\DataForm\FormLogin.cs:line 47 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll ---------------------------------------- Emergency Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///G:/%E9%99%84%E4%BB%B61%EF%BC%9A%E5%BA%94%E6%80%A5%E8%BE%85%E5%8A%A9%E7%B3%BB%E7%BB%9FV1.0%E5%AE%89%E8%A3%85%E5%8C%85/%E5%BA%94%E6%80%A5%E8%BE%85%E5%8A%A9%E7%B3%BB%E7%BB%9FV1.0%E5%AE%89%E8%A3%85%E5%8C%85/%E5%BA%94%E6%80%A5%E8%BE%85%E5%8A%A9%E7%B3%BB%E7%BB%9FV1.0/%E5%BA%94%E6%80%A5%E8%BE%85%E5%8A%A9%E7%B3%BB%E7%BB%9FV1.0.exe ---------------------------------------- System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Data Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- System.Transactions Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll ---------------------------------------- System.EnterpriseServices Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll ---------------------------------------- System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section.: Object reference not set to an instance of an object. at Emergency.Module.setControls(Single newx, Single newy, Control cons) in d:\Users\Desktop\站务中心应急辅助系统测试版\Emergency\Class\Module.cs:line 2944 at Emergency.FormMain.FormMain_Resize(Object sender, EventArgs e) in d:\Users\Desktop\站务中心应急辅助系统测试版\Emergency\DataForm\FormMain.cs:line 49 at System.Windows.Forms.Control.OnResize(EventArgs e) at System.Windows.Forms.Form.OnResize(EventArgs e) at System.Windows.Forms.Control.OnSizeChanged(EventArgs e) at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight) at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height) at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified) at System.Windows.Forms.Form.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified) at System.Windows.Forms.Control.ScaleControl(SizeF factor, BoundsSpecified specified) at System.Windows.Forms.ScrollableControl.ScaleControl(SizeF factor, BoundsSpecified specified) at System.Windows.Forms.Form.ScaleControl(SizeF factor, BoundsSpecified specified) at System.Windows.Forms.Control.ScaleControl(SizeF includedFactor, SizeF excludedFactor, Control requestingControl) at System.Windows.Forms.ContainerControl.Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl) at System.Windows.Forms.ContainerControl.PerformAutoScale(Boolean includedBounds, Boolean excludedBounds) at System.Windows.Forms.ContainerControl.PerformNeededAutoScaleOnLayout() at System.Windows.Forms.ContainerControl.OnLayoutResuming(Boolean performLayout) at System.Windows.Forms.Control.ResumeLayout(Boolean performLayout) at Emergency.FormMain.InitializeComponent() in d:\Users\Desktop\站务中心应急辅助系统测试版\Emergency\DataForm\FormMain.Designer.cs:line 2355 at Emergency.FormMain..ctor() in d:\Users\Desktop\站务中心应急辅助系统测试版\Emergency\DataForm\FormMain.cs:line 17 at Emergency.FormLogin.button1_Click(Object sender, EventArgs e) in d:\Users\Desktop\站务中心应急辅助系统测试版\Emergency\DataForm\FormLogin.cs:line 47 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll ---------------------------------------- Emergency Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///G:/%E9%99%84%E4%BB%B61%EF%BC%9A%E5%BA%94%E6%80%A5%E8%BE%85%E5%8A%A9%E7%B3%BB%E7%BB%9FV1.0%E5%AE%89%E8%A3%85%E5%8C%85/%E5%BA%94%E6%80%A5%E8%BE%85%E5%8A%A9%E7%B3%BB%E7%BB%9FV1.0%E5%AE%89%E8%A3%85%E5%8C%85/%E5%BA%94%E6%80%A5%E8%BE%85%E5%8A%A9%E7%B3%BB%E7%BB%9FV1.0/%E5%BA%94%E6%80%A5%E8%BE%85%E5%8A%A9%E7%B3%BB%E7%BB%9FV1.0.exe ---------------------------------------- System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Data Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- System.Transactions Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll ---------------------------------------- System.EnterpriseServices Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll ---------------------------------------- System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section.
VS2017安装Ankhsvn报错 此扩展不能安装在任何当前安装的产品上
![图片说明](https://img-ask.csdn.net/upload/201905/05/1557026782_516002.jpg) 日志信息 2019/5/5 11:22:20 - Microsoft VSIX Installer 2019/5/5 11:22:20 - ------------------------------------------- 2019/5/5 11:22:20 - vsixinstaller.exe version: 2019/5/5 11:22:20 - 15.9.3041 2019/5/5 11:22:20 - ------------------------------------------- 2019/5/5 11:22:20 - Command line parameters: 2019/5/5 11:22:20 - VSIXInstaller.exe,Ankh.VS15Package.vsix 2019/5/5 11:22:20 - ------------------------------------------- 2019/5/5 11:22:20 - Microsoft VSIX Installer 2019/5/5 11:22:20 - ------------------------------------------- 2019/5/5 11:22:20 - Initializing Install... 2019/5/5 11:22:20 - 扩展详细信息... 2019/5/5 11:22:20 - Identifier : AnkhSVN.2.7.417f85d8-1b5c-47ee-a8ae-b58359e79899 2019/5/5 11:22:20 - Name : AnkhSVN - Subversion Support for Visual Studio 2019/5/5 11:22:20 - Author : AnkhSVN Team & CollabNet 2019/5/5 11:22:20 - Version : 2.7.12815 2019/5/5 11:22:20 - Description : Open Source Subversion SCC Provider for Visual Studio 2005, 2008, 2010, 2012, 2013, 2015 and 2017. 2019/5/5 11:22:20 - Locale : en-US 2019/5/5 11:22:20 - MoreInfoURL : http://www.ankhsvn.net/ 2019/5/5 11:22:20 - InstalledByMSI : False 2019/5/5 11:22:20 - SupportedFrameworkVersionRange : [4.5,) 2019/5/5 11:22:20 - 2019/5/5 11:22:20 - SignatureState : Unsigned 2019/5/5 11:22:20 - 支持的产品 : 2019/5/5 11:22:20 - Microsoft.VisualStudio.Community 2019/5/5 11:22:20 - Version : [15.0,16.0) 2019/5/5 11:22:20 - Microsoft.VisualStudio.Pro 2019/5/5 11:22:20 - Version : [15.0,16.0) 2019/5/5 11:22:20 - Microsoft.VisualStudio.Enterprise 2019/5/5 11:22:20 - Version : [15.0,16.0) 2019/5/5 11:22:20 - Microsoft.VisualStudio.IntegratedShell 2019/5/5 11:22:20 - Version : [15.0,16.0) 2019/5/5 11:22:20 - 2019/5/5 11:22:20 - 引用 : 2019/5/5 11:22:20 - 系统必备 : 2019/5/5 11:22:20 - ------------------------------------------------------- 2019/5/5 11:22:20 - Identifier : Microsoft.VisualStudio.Component.CoreEditor 2019/5/5 11:22:20 - Name : Visual Studio core editor 2019/5/5 11:22:20 - Version : [15.0,16.0) 2019/5/5 11:22:20 - 2019/5/5 11:22:20 - 签名详细信息... 2019/5/5 11:22:20 - Extension is not signed. 2019/5/5 11:22:20 - 2019/5/5 11:22:20 - 正在搜索适用的产品... 2019/5/5 11:22:20 - 找到的已安装产品 - Microsoft Visual Studio 2010 Ultimate 2019/5/5 11:22:20 - 找到的已安装产品 - 全局位置 2019/5/5 11:22:20 - VSIXInstaller.NoApplicableSKUsException: 此扩展不能安装在任何当前安装的产品上。 在 VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData) 在 VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported) 在 VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported) 在 VSIXInstaller.App.Initialize(Boolean isRepairSupported) 在 VSIXInstaller.App.Initialize() 在 System.Threading.Tasks.Task`1.InnerInvoke() 在 System.Threading.Tasks.Task.Execute() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
ARToolkit在VS2010配置问题,链接时 LNK2019错误 (未解决)
#include "stdafx.h" #ifdef _WIN32 #include <windows.h> #endif #include <stdio.h> #include <stdlib.h> #ifndef __APPLE__ #include <GL/gl.h> #define GLUT_DISABLE_ATEXIT_HACK #include <GL/glut.h> #endif #include <AR/gsub.h> #include <AR/video.h> #include <AR/param.h> #include <AR/ar.h> // // Camera configuration. // #ifdef _WIN32 char *vconf = "Data\\WDM_camera_flipV.xml"; #else char *vconf = ""; #endif int xsize, ysize; int thresh = 100; int count = 0; char *cparam_name = "Data/camera_para.dat"; ARParam cparam; char *patt_name = "Data/patt.hiro"; int patt_id; double patt_width = 80.0; double patt_center[2] = {0.0, 0.0}; double patt_trans[3][4]; static void init(void); static void cleanup(void); static void keyEvent( unsigned char key, int x, int y); static void mainLoop(void); static void draw( void ); int main(int argc, char **argv) { glutInit(&argc, argv); init(); arVideoCapStart(); argMainLoop( NULL, keyEvent, mainLoop ); return (0); } static void keyEvent( unsigned char key, int x, int y) { /* quit if the ESC key is pressed */ if( key == 0x1b ) { printf("*** %f (frame/sec)\n", (double)count/arUtilTimer()); cleanup(); exit(0); } } /* main loop */ static void mainLoop(void) { ARUint8 *dataPtr; ARMarkerInfo *marker_info; int marker_num; int j, k; /* grab a vide frame */ if( (dataPtr = (ARUint8 *)arVideoGetImage()) == NULL ) { arUtilSleep(2); return; } if( count == 0 ) arUtilTimerReset(); count++; argDrawMode2D(); argDispImage( dataPtr, 0,0 ); /* detect the markers in the video frame */ if( arDetectMarker(dataPtr, thresh, &marker_info, &marker_num) < 0 ) { cleanup(); exit(0); } arVideoCapNext(); /* check for object visibility */ k = -1; for( j = 0; j < marker_num; j++ ) { if( patt_id == marker_info[j].id ) { if( k == -1 ) k = j; else if( marker_info[k].cf < marker_info[j].cf ) k = j; } } if( k == -1 ) { argSwapBuffers(); return; } /* get the transformation between the marker and the real camera */ arGetTransMat(&marker_info[k], patt_center, patt_width, patt_trans); draw(); argSwapBuffers(); } static void init( void ) { ARParam wparam; /* open the video path */ if( arVideoOpen( vconf ) < 0 ) exit(0); /* find the size of the window */ if( arVideoInqSize(&xsize, &ysize) < 0 ) exit(0); printf("Image size (x,y) = (%d,%d)\n", xsize, ysize); /* set the initial camera parameters */ if( arParamLoad(cparam_name, 1, &wparam) < 0 ) { printf("Camera parameter load error !!\n"); exit(0); } arParamChangeSize( &wparam, xsize, ysize, &cparam ); arInitCparam( &cparam ); printf("*** Camera Parameter ***\n"); arParamDisp( &cparam ); if( (patt_id=arLoadPatt(patt_name)) < 0 ) { printf("pattern load error !!\n"); exit(0); } /* open the graphics window */ argInit( &cparam, 1.0, 0, 0, 0, 0 ); } /* cleanup function called when program exits */ static void cleanup(void) { arVideoCapStop(); arVideoClose(); argCleanup(); } static void draw( void ) { double gl_para[16]; GLfloat mat_ambient[] = {0.0, 0.0, 1.0, 1.0}; GLfloat mat_flash[] = {0.0, 0.0, 1.0, 1.0}; GLfloat mat_flash_shiny[] = {50.0}; GLfloat light_position[] = {100.0,-200.0,200.0,0.0}; GLfloat ambi[] = {0.1, 0.1, 0.1, 0.1}; GLfloat lightZeroColor[] = {0.9, 0.9, 0.9, 0.1}; argDrawMode3D(); argDraw3dCamera( 0, 0 ); glClearDepth( 1.0 ); glClear(GL_DEPTH_BUFFER_BIT); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); /* load the camera transformation matrix */ argConvGlpara(patt_trans, gl_para); glMatrixMode(GL_MODELVIEW); glLoadMatrixd( gl_para ); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glLightfv(GL_LIGHT0, GL_POSITION, light_position); glLightfv(GL_LIGHT0, GL_AMBIENT, ambi); glLightfv(GL_LIGHT0, GL_DIFFUSE, lightZeroColor); glMaterialfv(GL_FRONT, GL_SPECULAR, mat_flash); glMaterialfv(GL_FRONT, GL_SHININESS, mat_flash_shiny); glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); glMatrixMode(GL_MODELVIEW); glTranslatef( 0.0, 0.0, 25.0 ); glutSolidCube(50.0); glDisable( GL_LIGHTING ); glDisable( GL_DEPTH_TEST ); } 1>ClCompile: 1> stdafx.cpp 1> ARFirstApplication.cpp 1>libARgsubd.lib(gsub.obj) : error LNK2019: 无法解析的外部符号 ___glutCreateWindowWithExit@8,该符号在函数 _glutCreateWindow_ATEXIT_HACK@4 中被引用 1>C:\Users\Yang\Documents\Visual Studio 2010\Projects\ARFirstApplication\Debug\ARFirstApplication.exe : fatal error LNK1120: 1 个无法解析的外部命令 1> 1>生成失败。 1> 1>已用时间 00:00:01.83 ========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
VS 2015 DEBUG模式启动修改EXE文件内容
最近看了一下.NET程序集重定向方面的资料,并写了一个小程序测试了一下。 发现了两个问题: 1,在Visual Studio 2015 DEBUG模式下启动程序之后,生成的exe文件被修改了。 这种情况只有在生成解决方案之后第一次从VS启动程序时才会发生。 ![图片说明](https://img-ask.csdn.net/upload/201702/26/1488107370_977655.png) 2,把程序集所在的文件用另外一个所包含的程序集版本不同的文件替换之后,再从DEBUG模式下启动,exe中的manifest清单中竟然记录得是最后最后那个程序集的版本号。 也就是说,exe引用的是最后一次替换的那个程序集的版本号,而不是最初的那个文件中所包含的程序集版本号。 ![图片说明](https://img-ask.csdn.net/upload/201702/26/1488107459_335499.png) 补充: 1,实现的语言是C#。 2,三个程序集都是强命名的。 3,.NET 版本是4.6 4,应用程序配置文件内容如下: ``` <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> </startup> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Toolkit" publicKeyToken="ba4d601feaaddbdb" culture="neutral"/> <bindingRedirect oldVersion="1.0.0.0" newVersion="2.1.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration> ``` 请问是什么原因造成这两个问题的?
vs2013的win32控制台程序+海康威视sdk,一直出现error LNK2019的问题
``` #include <stdio.h> #include <iostream> #include "Windows.h" #include "HCNetSDK.h" #include "plaympeg4.h" #include <time.h> using namespace std; typedef HWND(WINAPI *PROCGETCONSOLEWINDOW)(); PROCGETCONSOLEWINDOW ConsoleWindow; LONG lPort; //全局的播放库 port 号 void CALLBACK g_RealDataCallBack_V30(LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer, DWORD dwBufSize, void* dwUser) { HWND hWnd = ConsoleWindow(); switch (dwDataType) { case NET_DVR_SYSHEAD: //系统头 if (!PlayM4_GetPort(&lPort)) //获取播放库未使用的通道号 { break; } //m_iPort = lPort; //第一次回调的是系统头,将获取的播放库 port 号赋值给全局 port,下次回调数据时即使用此 port 号播放 if (dwBufSize > 0) { if (!PlayM4_SetStreamOpenMode(lPort, STREAME_REALTIME)) //设置实时流播放模式 { break; } if (!PlayM4_OpenStream(lPort, pBuffer, dwBufSize, 1024 * 1024)) //打开流接口 { break; } if (!PlayM4_Play(lPort, hWnd)) //播放开始 { break; } } break; case NET_DVR_STREAMDATA: //码流数据 if (dwBufSize > 0 && lPort != -1) { if (!PlayM4_InputData(lPort, pBuffer, dwBufSize)) { break; } } break; default: //其他数据 if (dwBufSize > 0 && lPort != -1) { if (!PlayM4_InputData(lPort, pBuffer, dwBufSize)) { break; } } break; } } void CALLBACK g_ExceptionCallBack(DWORD dwType, LONG lUserID, LONG lHandle, void *pUser) { char tempbuf[256] = { 0 }; switch (dwType) { case EXCEPTION_RECONNECT: //预览时重连 printf("----------reconnect--------%d\n", time(NULL)); break; default: break; } } void main() { //--------------------------------------- // 初始化 NET_DVR_Init(); //设置连接时间与重连时间 NET_DVR_SetConnectTime(2000, 1); NET_DVR_SetReconnect(10000, true); //--------------------------------------- // 获取控制台窗口句柄 HWND hWnd = ::FindWindow("ConsoleWindowClass",NULL); //--------------------------------------- // 注册设备 LONG lUserID; NET_DVR_DEVICEINFO_V30 struDeviceInfo; lUserID = NET_DVR_Login_V30("172.0.0.100", 8000, "admin", "12345", &struDeviceInfo); if (lUserID < 0) { printf("Login error, %d\n", NET_DVR_GetLastError()); NET_DVR_Cleanup(); return; } //--------------------------------------- //设置异常消息回调函数 NET_DVR_SetExceptionCallBack_V30(0, NULL, g_ExceptionCallBack, NULL); //--------------------------------------- //启动预览并设置回调数据流 LONG lRealPlayHandle; NET_DVR_PREVIEWINFO struPlayInfo = { 0 }; struPlayInfo.hPlayWnd = hWnd; //需要 SDK 解码时句柄设为有效值,仅取流不解码时可设为空 struPlayInfo.lChannel = 1; //预览通道号 struPlayInfo.dwStreamType = 0; //0-主码流,1-子码流,2-码流 3,3-码流 4,以此类推 struPlayInfo.dwLinkMode = 0; //0- TCP 方式,1- UDP 方式,2- 多播方式,3- RTP 方式,4-RTP/RTSP,5-RSTP/HTTP struPlayInfo.bBlocked = 1; //0- 非阻塞取流,1- 阻塞取流 lRealPlayHandle = NET_DVR_RealPlay_V40(lUserID, &struPlayInfo, g_RealDataCallBack_V30, NULL); if (lRealPlayHandle < 0) { printf("NET_DVR_RealPlay_V40 error\n"); NET_DVR_Logout(lUserID); NET_DVR_Cleanup(); return; } Sleep(10000); //--------------------------------------- //关闭预览 NET_DVR_StopRealPlay(lRealPlayHandle); //注销用户 NET_DVR_Logout(lUserID); NET_DVR_Cleanup(); return; } ``` 错误列表为: 错误 14 error LNK2019: 无法解析的外部符号 __imp__PlayM4_SetStreamOpenMode@8,该符号在函数 "void __stdcall g_RealDataCallBack_V30(long,unsigned long,unsigned char *,unsigned long,void *)" (?g_RealDataCallBack_V30@@YGXJKPAEKPAX@Z) 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 11 error LNK2019: 无法解析的外部符号 __imp__PlayM4_Play@8,该符号在函数 "void __stdcall g_RealDataCallBack_V30(long,unsigned long,unsigned char *,unsigned long,void *)" (?g_RealDataCallBack_V30@@YGXJKPAEKPAX@Z) 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 12 error LNK2019: 无法解析的外部符号 __imp__PlayM4_OpenStream@16,该符号在函数 "void __stdcall g_RealDataCallBack_V30(long,unsigned long,unsigned char *,unsigned long,void *)" (?g_RealDataCallBack_V30@@YGXJKPAEKPAX@Z) 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 13 error LNK2019: 无法解析的外部符号 __imp__PlayM4_InputData@12,该符号在函数 "void __stdcall g_RealDataCallBack_V30(long,unsigned long,unsigned char *,unsigned long,void *)" (?g_RealDataCallBack_V30@@YGXJKPAEKPAX@Z) 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 15 error LNK2019: 无法解析的外部符号 __imp__PlayM4_GetPort@4,该符号在函数 "void __stdcall g_RealDataCallBack_V30(long,unsigned long,unsigned char *,unsigned long,void *)" (?g_RealDataCallBack_V30@@YGXJKPAEKPAX@Z) 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 9 error LNK2019: 无法解析的外部符号 __imp__NET_DVR_StopRealPlay@4,该符号在函数 _main 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 5 error LNK2019: 无法解析的外部符号 __imp__NET_DVR_SetReconnect@8,该符号在函数 _main 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 3 error LNK2019: 无法解析的外部符号 __imp__NET_DVR_SetExceptionCallBack_V30@16,该符号在函数 _main 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 4 error LNK2019: 无法解析的外部符号 __imp__NET_DVR_SetConnectTime@8,该符号在函数 _main 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 10 error LNK2019: 无法解析的外部符号 __imp__NET_DVR_RealPlay_V40@16,该符号在函数 _main 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 7 error LNK2019: 无法解析的外部符号 __imp__NET_DVR_Logout@4,该符号在函数 _main 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 6 error LNK2019: 无法解析的外部符号 __imp__NET_DVR_Login_V30@20,该符号在函数 _main 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 1 error LNK2019: 无法解析的外部符号 __imp__NET_DVR_Init@0,该符号在函数 _main 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 8 error LNK2019: 无法解析的外部符号 __imp__NET_DVR_GetLastError@0,该符号在函数 _main 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 2 error LNK2019: 无法解析的外部符号 __imp__NET_DVR_Cleanup@0,该符号在函数 _main 中被引用 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\catch_video9\源.obj catch_video9 错误 16 error LNK1120: 15 个无法解析的外部命令 C:\Users\Lenovo\documents\visual studio 2013\Projects\catch_video9\Debug\catch_video9.exe catch_video9 其中catch_video9是程序名称…… 求大神指点……在下萌新一枚,很多编程上的知识还有待提高,希望大家可以帮我指出我的错误…… 在此谢谢大家!
vs2010 matlab2012b 混编问题请教
各位大牛: 近期在做一个 VS2010调用 matlab2012B 产生的C++文件的事情,但一直搞不定,能否指点一下,不胜感激! 环境 VS2010 管理器设置 debugX64 调用 matlab2012B 64位, 1、用matlab 编 my_plot.m文件 function [x]=my_plot(A,B) x=A+B; plot(A,B,'-r'); 2 mcc -W cpplib:my_plot -T link:lib my_plot.m 通过产生 my_plot.dll my_plot.h my_plot.lib 3、打开Vs2010 建立空窗体工程,管理器设置X64 编译运行通过 4、工程中加入相关matlab调用语句如下 #include "stdafx.h" #include "Form1.h" #include "my_plot.h" #include "mclcppclass.h" #include "mclmcrrt.h" #pragma comment(lib,"mclmcrrt.lib") #pragma comment(lib,"my_plot.lib") using namespace chuang; [STAThreadAttribute] int main(array<System::String ^> ^args) { mwArray mwX(1,11,mxDOUBLE_CLASS); mwArray mwY(1,11,mxDOUBLE_CLASS); mwArray mwZ(1,11,mxDOUBLE_CLASS);; int i; double x[1][11],y[1][11]; Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); if (!my_plotInitialize()) return -1; for(i=0; i<11; i++) { x[1][i] = i; y[1][i] = sin(x[1][i]); } mwX.SetData(*x, 11); mwY.SetData(*y, 11); // mwZ.SetData(*y, 11); my_plot(1,mwZ,mwX,mwY); //调Ì¡Â用®?my_plot my_plotTerminate(); Application::Run(gcnew Form1()); return 0; } 环境变量 Path D:\Program Files\MATLAB\R2012b\bin\win64;D:\Program Files\MATLAB\R2012b\bin 包含目录 D:\Program Files\MATLAB\R2012b\extern\include; D:\Program Files\MATLAB\R2012b\extern\include\win64;$(IncludePath) 库目录 D:\Program Files\MATLAB\R2012b\extern\lib\win64\microsoft; $(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64; 附加包含目录 D:\Program Files\MATLAB\R2012b\extern\include; D:\Program Files\MATLAB\R2012b\extern\include\win64;%(AdditionalIncludeDirectories) 编译报错: 1> 所有输出均为最新。 1>chuang.obj : error LNK2031: 无法为 "extern "C" int __clrcall array_ref_set_numeric_mxDouble_proxy(class array_ref *,double const *,unsigned __int64)" (?array_ref_set_numeric_mxDouble_proxy@@$$J0YMHPEAVarray_ref@@PEBN_K@Z) 生成 p/invoke;元数据中缺少调用约定 1>chuang.obj : error LNK2031: 无法为 "extern "C" class array_ref * __clrcall array_ref_deep_copy_proxy(class array_ref *)" (?array_ref_deep_copy_proxy@@$$J0YMPEAVarray_ref@@PEAV1@@Z) 生成 p/invoke;元数据中缺少调用约定 1>chuang.obj : error LNK2031: 无法为 "extern "C" int __clrcall mclGetMatrix_proxy(void * *,unsigned __int64,unsigned __int64,enum mxClassID,enum mxComplexity)" (?mclGetMatrix_proxy@@$$J0YMHPEAPEAX_K1W4mxClassID@@W4mxComplexity@@@Z) 生成 p/invoke;元数据中缺少调用约定 1>chuang.obj : error LNK2031: 无法为 "extern "C" char const * __clrcall char_buffer_get_buffer_proxy(class char_buffer *)" (?char_buffer_get_buffer_proxy@@$$J0YMPEBDPEAVchar_buffer@@@Z) 生成 p/invoke;元数据中缺少调用约定 1>chuang.obj : error LNK2031: 无法为 "extern "C" int __clrcall char_buffer_set_buffer_proxy(class char_buffer *,char const *)" (?char_buffer_set_buffer_proxy@@$$J0YMHPEAVchar_buffer@@PEBD@Z) 生成 p/invoke;元数据中缺少调用约定 1>chuang.obj : error LNK2031: 无法为 "extern "C" int __clrcall mclCreateCharBuffer_proxy(void * *,char const *)" (?mclCreateCharBuffer_proxy@@$$J0YMHPEAPEAXPEBD@Z) 生成 p/invoke;元数据中缺少调用约定 1>chuang.obj : error LNK2031: 无法为 "extern "C" int __clrcall mclcppGetLastError_proxy(void * *)" (?mclcppGetLastError_proxy@@$$J0YMHPEAPEAX@Z) 生成 p/invoke;元数据中缺少调用约定 1>chuang.obj : error LNK2031: 无法为 "extern "C" char const * __clrcall error_info_get_message_proxy(class error_info *)" (?error_info_get_message_proxy@@$$J0YMPEBDPEAVerror_info@@@Z) 生成 p/invoke;元数据中缺少调用约定 @Z) 生成 p/invoke;元数据中缺少调用约定 1>chuang.obj : error LNK2031: 无法为 "extern "C" int __clrcall ref_count_obj_addref_proxy(class ref_count_obj *)" (?ref_count_obj_addref_proxy@@$$J0YMHPEAVref_count_obj@@@Z) 生成 p/invoke;元数据中缺少调用约定 1>chuang.obj : error LNK2031: 无法为 "extern "C" int __clrcall mclcppCreateError_proxy(void * *,char const *)" (?mclcppCreateError_proxy@@$$J0YMHPEAPEAXPEBD@Z) 生成 p/invoke;元数据中缺少调用约定 1>chuang.obj : error LNK2028: 无法解析的标记(0A00003F) "extern "C" int __clrcall array_ref_set_numeric_mxDouble_proxy(class array_ref *,double const *,unsigned __int64)" (?array_ref_set_numeric_mxDouble_proxy@@$$J0YMHPEAVarray_ref@@PEBN_K@Z),该标记在函数 "public: void __clrcall mwArray::SetData(double *,unsigned __int64)" (?SetData@mwArray@@$$FQEAMXPEAN_K@Z) 中被引用 1>chuang.obj : error LNK2028: 无法解析的标记(0A0000E9) "extern "C" class array_ref * __clrcall array_ref_deep_copy_proxy(class array_ref *)" (?array_ref_deep_copy_proxy@@$$J0YMPEAVarray_ref@@PEAV1@@Z),该标记在函数 "public: __clrcall mwArray::mwArray(class mwArray const &)" (??0mwArray@@$$FQEAM@AEBV0@@Z) 中被引用 1>chuang.obj : error LNK2028: 无法解析的标记(0A0000FA) "extern "C" int __clrcall mclGetMatrix_proxy(void * *,unsigned __int64,unsigned __int64,enum mxClassID,enum mxComplexity)" (?mclGetMatrix_proxy@@$$J0YMHPEAPEAX_K1W4mxClassID@@W4mxComplexity@@@Z),该标记在函数 "public: __clrcall mwArray::mwArray(unsigned __int64,unsigned __int64,enum mxClassID,enum mxComplexity)" (??0mwArray@@$$FQEAM@_K0W4mxClassID@@W4mxComplexity@@@Z) 中被引用 1>chuang.obj : error LNK2028: 无法解析的标记(0A00010E) "extern "C" char const * __clrcall char_buffer_get_buffer_proxy(class char_buffer *)" (?char_buffer_get_buffer_proxy@@$$J0YMPEBDPEAVchar_buffer@@@Z),该标记在函数 "public: __clrcall mwString::operator char const *(void)const " (??BmwString@@$$FQEBMPEBDXZ) 中被引用 1>chuang.obj : error LNK2028: 无法解析的标记(0A000110) "extern "C" int __clrcall char_buffer_set_buffer_proxy(class char_buffer *,char const *)" (?char_buffer_set_buffer_proxy@@$$J0YMHPEAVchar_buffer@@PEBD@Z),该标记在函数 "public: __clrcall mwString::mwString(class mwString const &)" (??0mwString@@$$FQEAM@AEBV0@@Z) 中被引用 1>chuang.obj : error LNK2028: 无法解析的标记(0A000111) "extern "C" int __clrcall mclCreateCharBuffer_proxy(void * *,char const *)" (?mclCreateCharBuffer_proxy@@$$J0YMHPEAPEAXPEBD@Z),该标记在函数 "public: __clrcall mwString::mwString(class mwString const &)" (??0mwString@@$$FQEAM@AEBV0@@Z) 中被引用 1>chuang.obj : error LNK2028: 无法解析的标记(0A000115) "extern "C" int __clrcall mclcppGetLastError_proxy(void * *)" (?mclcppGetLastError_proxy@@$$J0YMHPEAPEAX@Z),该标记在函数 "public: static void __clrcall mwException::raise_error(void)" (?raise_error@mwException@@$$FSMXXZ) 中被引用 1>chuang.obj : error LNK2028: 无法解析的标记(0A000116) "extern "C" char const * __clrcall error_info_get_message_proxy(class error_info *)" (?error_info_get_message_proxy@@$$J0YMPEBDPEAVerror_info@@@Z),该标记在函数 "public: virtual char const * __clrcall mwException::what(void)const " (?what@mwException@@$$FUEBMPEBDXZ) 中被引用 1>chuang.obj : error LNK2028: 无法解析的标记(0A000117) "extern "C" int __clrcall ref_count_obj_release_proxy(class ref_count_obj *)" (?ref_count_obj_release_proxy@@$$J0YMHPEAVref_count_obj@@@Z),该标记在函数 "public: virtual __clrcall mwArray::~mwArray(void)" (??1mwArray@@$$FUEAM@XZ) 中被引用 1>chuang.obj : error LNK2028: 无法解析的标记(0A000118) "extern "C" int __clrcall ref_count_obj_addref_proxy(class ref_count_obj *)" (?ref_count_obj_addref_proxy@@$$J0YMHPEAVref_count_obj@@@Z),该标记在函数 "public: __clrcall mwException::mwException(class mwException const &)" (??0mwException@@$$FQEAM@AEBV0@@Z) 中被引用 1>chuang.obj : error LNK2028: 无法解析的标记(0A000119) "extern "C" int __clrcall mclcppCreateError_proxy(void * *,char const *)" (?mclcppCreateError_proxy@@$$J0YMHPEAPEAXPEBD@Z),该标记在函数 "public: __clrcall mwException::mwException(void)" (??0mwException@@$$FQEAM@XZ) 中被引用 1>chuang.obj : error LNK2019: 无法解析的外部符号 "extern "C" char const * __clrcall error_info_get_message_proxy(class error_info *)" (?error_info_get_message_proxy@@$$J0YMPEBDPEAVerror_info@@@Z),该符号在函数 "public: virtual char const * __clrcall mwException::what(void)const " (?what@mwException@@$$FUEBMPEBDXZ) 中被引用 1>chuang.obj : error LNK2019: 无法解析的外部符号 "extern "C" int __clrcall ref_count_obj_release_proxy(class ref_count_obj *)" (?ref_count_obj_release_proxy@@$$J0YMHPEAVref_count_obj@@@Z),该符号在函数 "public: virtual __clrcall mwArray::~mwArray(void)" (??1mwArray@@$$FUEAM@XZ) 中被引用 1>chuang.obj : error LNK2019: 无法解析的外部符号 "extern "C" int __clrcall mclcppCreateError_proxy(void * *,char const *)" (?mclcppCreateError_proxy@@$$J0YMHPEAPEAXPEBD@Z),该符号在函数 "public: __clrcall mwException::mwException(void)" (??0mwException@@$$FQEAM@XZ) 中被引用 1>chuang.obj : error LNK2019: 无法解析的外部符号 "extern "C" int __clrcall ref_count_obj_addref_proxy(class ref_count_obj *)" (?ref_count_obj_addref_proxy@@$$J0YMHPEAVref_count_obj@@@Z),该符号在函数 "public: __clrcall mwException::mwException(class mwException const &)" (??0mwException@@$$FQEAM@AEBV0@@Z) 中被引用 1>chuang.obj : error LNK2019: 无法解析的外部符号 "extern "C" int __clrcall mclcppGetLastError_proxy(void * *)" (?mclcppGetLastError_proxy@@$$J0YMHPEAPEAX@Z),该符号在函数 "public: static void __clrcall mwException::raise_error(void)" (?raise_error@mwException@@$$FSMXXZ) 中被引用 1>chuang.obj : error LNK2019: 无法解析的外部符号 "extern "C" char const * __clrcall char_buffer_get_buffer_proxy(class char_buffer *)" (?char_buffer_get_buffer_proxy@@$$J0YMPEBDPEAVchar_buffer@@@Z),该符号在函数 "public: __clrcall mwString::operator char const *(void)const " (??BmwString@@$$FQEBMPEBDXZ) 中被引用 1>chuang.obj : error LNK2019: 无法解析的外部符号 "extern "C" class array_ref * __clrcall array_ref_deep_copy_proxy(class array_ref *)" (?array_ref_deep_copy_proxy@@$$J0YMPEAVarray_ref@@PEAV1@@Z),该符号在函数 "public: __clrcall mwArray::mwArray(class mwArray const &)" (??0mwArray@@$$FQEAM@AEBV0@@Z) 中被引用 1>chuang.obj : error LNK2019: 无法解析的外部符号 "extern "C" int __clrcall array_ref_set_numeric_mxDouble_proxy(class array_ref *,double const *,unsigned __int64)" (?array_ref_set_numeric_mxDouble_proxy@@$$J0YMHPEAVarray_ref@@PEBN_K@Z),该符号在函数 "public: void __clrcall mwArray::SetData(double *,unsigned __int64)" (?SetData@mwArray@@$$FQEAMXPEAN_K@Z) 中被引用 1>chuang.obj : error LNK2019: 无法解析的外部符号 "extern "C" int __clrcall char_buffer_set_buffer_proxy(class char_buffer *,char const *)" (?char_buffer_set_buffer_proxy@@$$J0YMHPEAVchar_buffer@@PEBD@Z),该符号在函数 "public: __clrcall mwString::mwString(class mwString const &)" (??0mwString@@$$FQEAM@AEBV0@@Z) 中被引用 ing@@$$FQEAM@AEBV0@@Z) 中被引用 @@$$FQEAM@_K0W4mxClassID@@W4mxComplexity@@@Z) 中被引用 1>E:\mat-vcc-test\chuang\x64\Debug\chuang.exe : fatal error LNK1120: 22 个无法解析的外部命令 1>
VS2017存档总是失败,不知道是什么原因?
网上下了一个基于Xamarin开发的安卓应用源码项目,当我修改代码等检查都没有问题后就开始存档,但每次存档VS2017总是跳出失败,提示“请先确保存档前先生成项目”我就很纳闷。 ![这是错误提示](https://img-ask.csdn.net/upload/201901/20/1547975489_126884.png) 这是错误代码 2>------ 已启动生成: 项目: PlayTube.Android, 配置: Debug Any CPU ------ 2>D:\playtube-mobile-application\PlayTube_v1.1\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets(225,5): warning : All projects referencing PlayTube.csproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569. 2>D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: 发现“Microsoft.CSharp”的不同版本间存在无法解决的冲突。当日志详细信息设置为“详细”时,这些引用冲突将会在生成日志中列出。 2>D:\playtube-mobile-application\PlayTube_v1.1\packages\Xamarin.Build.Download.0.4.7\build\Xamarin.Build.Download.targets(62,3): error XBD009: Partial Download Failed for one or more parts 2>D:\playtube-mobile-application\PlayTube_v1.1\packages\Xamarin.Build.Download.0.4.7\build\Xamarin.Build.Download.targets(62,3): error : 发送请求时出错。 2>D:\playtube-mobile-application\PlayTube_v1.1\packages\Xamarin.Build.Download.0.4.7\build\Xamarin.Build.Download.targets(62,3): error XBD404: Please open the Android SDK Manager and install the latest version of 'Google Repository' from the 'Extras' section, and then reload your solution. 这是生成解决方案错误提示
未能加载文件或程序集,流入了不在清单中的模块。 (异常来自 HRESULT:0x80131043)
未能加载文件或程序集“DD_Mgd_3.02_8”或它的某一个依赖项。流入了不在清单中的模块。 (异常来自 HRESULT:0x80131043) 说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.IO.FileLoadException: 未能加载文件或程序集“DD_Mgd_3.02_8”或它的某一个依赖项。流入了不在清单中的模块。 (异常来自 HRESULT:0x80131043) 源错误: 执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 程序集加载跟踪: 下列信息有助于确定程序集“DD_Mgd_3.02_8”未能加载的原因。 === 预绑定状态信息 === 日志: DisplayName = DD_Mgd_3.02_8 (Partial) 警告: 为程序集提供了部分绑定信息: 警告: 程序集名称: DD_Mgd_3.02_8 | 域 ID: 2 警告: 当仅提供程序集显示名称的一部分时,将发生部分绑定。 警告: 这可能导致联编程序加载错误的程序集。 警告: 建议为程序集提供完全指定的文字标识, 警告: 并由简单名称、版本、区域性和公钥标记组成。 警告: 有关此问题的详细信息和常见解决方案,请参见白皮书 http://go.microsoft.com/fwlink/?LinkId=109270。 日志: Appbase = file:///D:/Users/jiushiyang/Documents/Visual Studio 2013/Projects/Bpo/DTcms.Web/ 日志: 初始 PrivatePath = D:\Users\jiushiyang\Documents\Visual Studio 2013\Projects\Bpo\DTcms.Web\bin 调用程序集: (Unknown)。 === 日志: 此绑定从 default 加载上下文开始。 日志: 正在使用应用程序配置文件: D:\Users\jiushiyang\Documents\Visual Studio 2013\Projects\Bpo\DTcms.Web\web.config 日志: 使用主机配置文件: C:\Users\jiushiyang\Documents\IISExpress\config\aspnet.config 日志: 使用 C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config 的计算机配置文件。 日志: 此时没有为引用应用策略(私有、自定义、分部或基于位置的程序集绑定)。 日志: 尝试下载新的 URL file:///C:/Users/jiushiyang/AppData/Local/Temp/Temporary ASP.NET Files/root/330458e9/7a545a62/DD_Mgd_3.02_8.DLL。 日志: 尝试下载新的 URL file:///C:/Users/jiushiyang/AppData/Local/Temp/Temporary ASP.NET Files/root/330458e9/7a545a62/DD_Mgd_3.02_8/DD_Mgd_3.02_8.DLL。 日志: 尝试下载新的 URL file:///D:/Users/jiushiyang/Documents/Visual Studio 2013/Projects/Bpo/DTcms.Web/bin/DD_Mgd_3.02_8.DLL。 日志: 正在使用应用程序配置文件: D:\Users\jiushiyang\Documents\Visual Studio 2013\Projects\Bpo\DTcms.Web\web.config 日志: 使用主机配置文件: C:\Users\jiushiyang\Documents\IISExpress\config\aspnet.config 日志: 使用 C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config 的计算机配置文件。 日志: 策略后引用: DD_Mgd_3.02_8, Version=3.0.0.31720, Culture=neutral, PublicKeyToken=954bd47eaa10a352 错误: 未能完成程序集的安装(hr = 0x80131043)。探测终止。 堆栈跟踪: [FileLoadException: 未能加载文件或程序集“DD_Mgd_3.02_8”或它的某一个依赖项。流入了不在清单中的模块。 (异常来自 HRESULT:0x80131043)] [FileLoadException: 未能加载文件或程序集“DD_Mgd_3.02_8, Version=3.0.0.31720, Culture=neutral, PublicKeyToken=954bd47eaa10a352”或它的某一个依赖项。流入了不在清单中的模块。 (异常来自 HRESULT:0x80131043)] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38 [ConfigurationErrorsException: 未能加载文件或程序集“DD_Mgd_3.02_8, Version=3.0.0.31720, Culture=neutral, PublicKeyToken=954bd47eaa10a352”或它的某一个依赖项。流入了不在清单中的模块。 (异常来自 HRESULT:0x80131043)] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290 System.Web.Compilation.BuildManager.ExecutePreAppStart() +157 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +549 [HttpException (0x80004005): 未能加载文件或程序集“DD_Mgd_3.02_8, Version=3.0.0.31720, Culture=neutral, PublicKeyToken=954bd47eaa10a352”或它的某一个依赖项。流入了不在清单中的模块。 (异常来自 HRESULT:0x80131043)] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10084960 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254 版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.7.2103.2
C++类将类的构造器设置为内联的,然后main函数和类的实现不在一个.cpp文件中则会报错
我在测试书上的例子时,按书上把类的构造器前加了inline,main函数和类的实现不在同一个文件中,在测试时报了如下错误: 1>Main.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall UserProfile::UserProfile(void)" (??0UserProfile@@QAE@XZ),该符号在函数 _main 中被引用 1>Main.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall UserProfile::UserProfile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,enum UserProfile::uLevel)" (??0UserProfile@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4uLevel@0@@Z),该符号在函数 _main 中被引用 1>D:\Visual Studio 2015\Projects\STLStudy\Debug\STLStudy.exe : fatal error LNK1120: 2 个无法解析的外部命令 我把inline去掉或是把main函数放在类的实现的文件中时,就可以正常运行了。想知道为什么。编译器是vs2015
窗体运用程序中借助dataGridView接收传过来的值是显示未将对象引用设置到对象的实例
winform设计中借助dataGridView实现窗体传值把值传到主窗体中, 报错显示未将对象引用设置到对象的实例 private void InformationSave_Load(object sender, EventArgs e) { //设置列的数目 dataGridView1.ColumnCount = 11; dataGridView1.ColumnHeadersVisible = true; //为每一个单元格添加标题 dataGridView1.Columns[0].Name = "图书编号"; dataGridView1.Columns[1].Name = "图书名称"; dataGridView1.Columns[2].Name = "入库时间"; dataGridView1.Columns[3].Name = "图书分类"; dataGridView1.Columns[4].Name = "作者"; dataGridView1.Columns[5].Name = "拼音码"; dataGridView1.Columns[6].Name = "页数"; dataGridView1.Columns[7].Name = "版本"; dataGridView1.Columns[8].Name = "存放位置"; dataGridView1.Columns[9].Name = "图书价格"; dataGridView1.Columns[10].Name = "内容描述"; BookAdd frm = (BookAdd)this.Owner; try { frm.Controls["txtName"].Text = (string)dataGridView1.Rows[1].Cells[0].Value; } catch { MessageBox.Show("存放失败"); }
未能加载文件或程序集“ ”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。
.net 开发,本地测试没有问题,放到服务器上就报错 System.IO.FileLoadException: 未能加载文件或程序集“System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040) 文件名:“System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” 在 GaoQiManage.Web.Controllers.CourseVideoController.CreateUploadVideo(String Title, String FileName, String Description, String coverurl, String& VideoId, String& UploadAddress, String& UploadAuth) 在 GaoQiManage.Web.Controllers.CourseVideoController.UploadVideo(String Title, String FileName, String Description, String coverurl, Stream stream, String& VideoId) 位置 D:\Work\GaoQi\GaoQiManage.Web\Controllers\CourseVideoController.cs:行号 115 警告: 程序集绑定日志记录被关闭。 要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。 注意: 会有一些与程序集绑定失败日志记录关联的性能损失。 要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。
在中国程序员是青春饭吗?
今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
复习一周,京东+百度一面,不小心都拿了Offer
京东和百度一面都问了啥,面试官百般刁难,可惜我全会。
Java 14 都快来了,为什么还有这么多人固守Java 8?
从Java 9开始,Java版本的发布就让人眼花缭乱了。每隔6个月,都会冒出一个新版本出来,Java 10 , Java 11, Java 12, Java 13, 到2020年3月份,...
达摩院十大科技趋势发布:2020 非同小可!
【CSDN编者按】1月2日,阿里巴巴发布《达摩院2020十大科技趋势》,十大科技趋势分别是:人工智能从感知智能向认知智能演进;计算存储一体化突破AI算力瓶颈;工业互联网的超融合;机器间大规模协作成为可能;模块化降低芯片设计门槛;规模化生产级区块链应用将走入大众;量子计算进入攻坚期;新材料推动半导体器件革新;保护数据隐私的AI技术将加速落地;云成为IT技术创新的中心 。 新的画卷,正在徐徐展开。...
轻松搭建基于 SpringBoot + Vue 的 Web 商城应用
首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。Fun: Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API ...
讲真,这两个IDE插件,可以让你写出质量杠杠的代码
周末躺在床上看《拯救大兵瑞恩》 周末在闲逛的时候,发现了两个优秀的 IDE 插件,据说可以提高代码的质量,我就安装了一下,试了试以后发现,确实很不错,就推荐给大家。 01、Alibaba Java 代码规范插件 《阿里巴巴 Java 开发手册》,相信大家都不会感到陌生,其 IDEA 插件的下载次数据说达到了 80 万次,我今天又贡献了一次。嘿嘿。 该项目的插件地址: https://github....
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
2020 年,大火的 Python 和 JavaScript 是否会被取而代之?
Python 和 JavaScript 是目前最火的两大编程语言,但是2020 年,什么编程语言将会取而代之呢? 作者 |Richard Kenneth Eng 译者 |明明如月,责编 | 郭芮 出品 | CSDN(ID:CSDNnews) 以下为译文: Python 和 JavaScript 是目前最火的两大编程语言。然而,他们不可能永远屹立不倒。最终,必将像其他编程语言一...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
Idea 中最常用的10款插件(提高开发效率),一定要学会使用!
学习使用一些插件,可以提高开发效率。对于我们开发人员很有帮助。这篇博客介绍了开发中使用的插件。
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
立即提问