我正在移植.NET 3.5 - 4.5中的一些代码.在我的程序集内部,我有一些代码从当前正在执行的程序集中读取资源.但是,DNX核心5.0中GetExecutingAssembly()的Assembly类型不是方法.
var xsdStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(xsdPath);
Run Code Online (Sandbox Code Playgroud)
Assembly.GetExecutingAssembly()在DNX核心5.0中相当于什么?或者,如果我需要一个命名空间来获取该方法(也许是扩展方法?),那么命名空间是什么?
我使用SQLServer程序集运行我的Winforms应用程序Microsoft.SqlServer.ConnectionInfo(13.100.0.0)Microsoft.SqlServer.SMO(13.100.0.0)
在同一台机器上安装了SSMS 2016(Aug).这里也安装了SQL 2014开发版.
当我运行我的应用程序时,它给了我一个错误:
?onnection = new ServerConnection(instanceName);
------------
Could not load file or assembly ‘microsoft.sqlserver.sqlclrprovider version=13.100.0.0?
Run Code Online (Sandbox Code Playgroud)
我检查过:GAC包含一些这样的程序集11,12,13.0.0.0,但是没有13.100.0.0.
该应用程序已从以下引用程序集:C:\ Program Files(x86)\ Microsoft SQL Server\130\DTS\Tasks
Microsoft.SqlServer.ConnectionInfo (13.100.0.0)
Microsoft.SqlServer.SMO(13.100.0.0)
Run Code Online (Sandbox Code Playgroud)
我的操作系统是Windows 7,我认为所有13.100.0都是由SSMS安装程序安装的.如何解决这个问题呢?我可以找到程序集microsoft.sqlserver.sqlclrprovider 13.100.0.0吗?
我可以使用吗?:
Assembly.LoadFile
Run Code Online (Sandbox Code Playgroud)
不确定这是否是这样做的?
但是当我尝试这种方法时,它会抛出一个Could not load file or assembly "CustomControlLib"或一个依赖项.该系统找不到指定的文件.
有任何想法吗?
查看编译器从我的文件生成的代码的最佳(最快)方法是什么?我主要使用的是C++,但是也适用于.NET语言的解决方案.
我有一个ASP.NET MVC 2网站(VS2010),我已升级到ASP.NET MVC 3(VS2012),这可以在本地IIS7上运行,但在发布时我在主机上得到此异常:
Could not load file or assembly 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)
在一些seartch之后,我发现这表明我应该在一些引用上设置CopyLocal(包含System.Web.WebPages)并且还使用VS2012中的发布工具,但这会产生以下异常?
Could not load file or assembly 'System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)
我找不到任何部署DLL来设置copyLocal?
我该怎么解决这个问题?
我正在用C#开发一个aps.net网站,我正在使用框架4.在创建一个新的网站项目后,我尝试运行该项目.但我得到以下错误
Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\myfirst\159977c5\b9e740fc\App_global.asax.yfqtni9g.dll' or one of its dependencies. The system cannot find the file specified.
我已经通过以下链接[和所有谈到访问该文件夹],但我没有帮助我:(
无法加载文件或程序集'file:/// C:\ WINDOWS\Microsoft.NET\Framework\v4.0.30319\asp.net vs2010 ASP.NET损坏程序集"无法加载文件或程序集App_Web_*" http://web.archive.org/web/20101023213019/http://www.yetanotherdeveloper.com/post/2008/08/10/Could-not-load-file-or-assembly-App_Web.aspx我检查并完全访问"临时ASP.NET文件"及其用户组的子文件夹和文件.
WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
我情况非常糟糕.我丢失了我的源代码,我的客户需要在应用程序中稍微改变一下.考虑编辑程序集的示例:Test.dll然后添加代码行,最后重新编译它
所以我的问题是: - 有可能这样做吗? - 如果可能的话,编辑程序集然后重新编译它的好工具是什么?
这可能是一个非常简单的问题,但我完全迷失了,寻找答案并没有帮助.
我有一些powershell代码来显示带有TextBoxes的简单GUI.某些文本框允许用户按Enter键以运行Button_Click代码.当我尝试运行PS1脚本时,出现以下错误:
Unable to find type [System.Windows.Forms.KeyEventHandler].
Make sure that the assembly that contains this type is loaded.At C:\Scripts\GUI-Testing.ps1:161 char:1
$TestVar=[System.Windows.Forms.KeyEventHandler]
CategoryInfo : InvalidOperation: (System.Windows.Forms.KeyEventHandler:TypeName)
FullyQualifiedErrorId : TypeNotFound
Run Code Online (Sandbox Code Playgroud)
奇怪的一部分,如果我关闭GUI,然后重新运行该脚本,我没有得到的Unable to find type错误,并根据需要按下Enter键的作品.
以为我有一个答案,我尝试使用[void][reflection.assembly]::Load('System.Windows.Forms.KeyEventHandler')哪个给出了这个错误Exception calling "Load" with "1" argument(s): "Could not load file or assembly 'System.Windows.Forms.KeyEventHandler' or one of its dependencies. [FileNotFoundException]
当我用来GetManifestResourceStream从.NET程序集中检索嵌入式资源时,涉及哪种I/O?
我看到两种可能性:
当.NET加载它时,整个程序集已经被放入内存中,因此GetManifestResourceStream只是访问内存.
当程序集由.NET加载时,只有程序集的代码部分被放入内存中,因此GetManifestResourceStream需要返回到.dll文件以提取嵌入的资源.
我很确定第一种情况,特别是因为程序集可以从原始数据动态加载Assembly.Load(Byte[]).但后来我想知道如果嵌入了一个非常大的文件(比如几千兆字节)会发生什么 - 第二个选项可能更有效.尺寸重要吗?
只是挑战一些长期存在的假设,并且无法在此基础上找到太多参考.
我最近建立了一个新的Windows Server 2012 R2环境并安装了Visual Studio 2012.
现在我遇到了多个.NET 4.5项目的问题,我从我的旧服务器,Windows Server 2008机器迁移了.这从未发生在旧服务器上.
尝试从网络位置加载程序集时,我遇到以下问题:
尝试从网络位置加载程序集,这会导致程序集在以前版本的.NET Framework中被沙箱化.此版本的.NET Framework默认情况下不启用CAS策略,因此此负载可能很危险.如果此负载不是用于沙盒装配,请启用loadFromRemoteSources开关.有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkId=155569.
我看着 在 一些 其他 的问题,但他们没有提供一个可行的解决方案.
这是我到目前为止所尝试的:
loadFromRemoteSources开关.一切都没有成功.
有没有其他解决方案来解决这个问题?
.net .net-assembly visual-studio .net-4.5 visual-studio-2012
.net-assembly ×10
.net ×7
c# ×3
.net-4.5 ×1
asp.net ×1
asp.net-core ×1
asp.net-mvc ×1
c++ ×1
decompiler ×1
dnx ×1
hosting ×1
iis ×1
powershell ×1
refactoring ×1
reflection ×1
smo ×1
sql-server ×1
visual-c++ ×1