I just installed a fresh copy with source code of DotNetNuke 06.02.05.
I have compiled using VS 2010 but couldn't complete because of the following exception in globals.cs
Object reference not set to an instance of an object.
Source:
string strMessage = DataProvider.Instance().GetProviderPath();
i didn't change anything in the code, just opened the solution and compile.
Any suggestions.
Remove the web.config renamed release.config to web.config.
Related
I have a WPF application that reads a CSV file using CSVHelper which I installed using NuGet. Here's the project, system, etc version info.
Microsoft Windows 7 Professional Version 6.1.7601 Service Pack 1 Build
7601
Microsoft Visual Studio Community 2019 Version 16.4.5
NuGet Package Manager 5.4.0
WPF Project Target Framework: .NET Framework 4.7.2
CSVHelper Version: 15.0.5
CSV reader method is straightforward; read a file and put it in a list. Nothing fancy. I'll link the entire project at the bottom so you can download and try it out if you want.
When I run the executable made in either Release or Debug builds, they work fine. They read the file, put contents in a list, and display on a DataGrid just fine. As a next step, I created a standard Visual Studio Setup project, and created an msi installer, which I used to install the app in my PC.
When I run that executable (which is in my Program Files directory), however, the application throws an exception. Here's the exception message and Stack Trace.
Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)
at ReadCSVTest.MainWindow.ReadPeopleList(String path, List`1& people, String& msg)
at ReadCSVTest.MainWindow..ctor()
Since the error says couldn't load the assembly Microsoft.Bcl.AsyncInterfaces, I added that from NuGet and ran everything again, and I still get the error. What's the problem here? What does it mean that Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context.? And why do I only get this exception when I run the executable installed by the Setup project?
Please download the entire project from HERE.
Just so anyone runs into the same issue in the future; as Jones suggested in the comments, downgrading each of the two libraries to following versions fixed the issue for me.
CsvHelper ==> 12.3.2
And
Microsoft.Bcl.AsyncInterfaces ==> 1.0.0
When we are using Xamarin and MvvmCross to build a project for Phone. In this project we have added a SQLite db using SQLite plugin from MvvmCross, we have also added the SQLite3 dll to our debug folder. When we build everything is fine, but when we run the application we get the following exception:
Exception {Cirrious.CrossCore.Exceptions.MvxIoCResolveException: Failed to construct LocalPersistDataService ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
From the output: A first chance exception of type 'System.DllNotFoundException' occurred in Cirrious.MvvmCross.Plugins.Sqlite.WindowsCommon.DLL
Using Visual Studio 2013 and Windows Phone 8.1 RT
We solved it with adding an package from sqlite.org and then got (out of nothing day 2) a reference in our add Reference on Windows Phone, this link might be of help to others with the same problem. (Down on the page there is a section on WPF)
http://developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/databases/
After adding Catel implementation to one of my views(mainPage) in my project I have a bug that crashes my Silverlight project. The only indication I have is :" A first chance exception of type 'System.NullReferenceException' occurred in Catel.MVVM " (just about after setting the RootVisual~) - I can't find what I'm doing wrong, and since I am planing on a long-term relationship with Catel I thought that stepping through Catel code might come in handy, so I tried and failed in all the following steps (any help will be appreciated.. because currently I'm stuck and can't find anything):
downloaded catel 3.9 source files (same as my nuget package) and tried building it.. failed with this error :
E:\Dev\Catel-3.9.0\src\Catel.Core\Catel.Core.SL5\Fody.targets(51,5): error MSB4036: The "Fody.WeavingTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with in the project file, or in the *.tasks files located in the "E:\WINDOWS\Microsoft.NET\Framework\v4.0.30319" directory. - trying to search and figure the reasons and overcome this, lead me to nowhere. :(
i have followed this "Stepping through the code" instruction in Catel documentation but noting really happened (I'm using VS2010..is this an issue ?? )
I read this article & readme.md at : https://github.com/GeertvanHorrik/GitHubLink about using GitHubLink to help you stepping through Catel code while debugging. I downloaded the release GitHubLink 1.3.0 from https://github.com/GeertvanHorrik/GitHubLink/releases/tag/1.3.0 ... but running this even with just the githublink.exe -help flag had thrown a exception..
I downloaded the Githublink-master source files but 0 projects were loaded (the GithubLink project file is incompatible with the current version of VS - I'm using VS2010)
can anyone help me either shade some light or:
overcome the build error I receive for catel (no.1)
instruct me how to set & step into catel ?
share the pdb files for Catel libs
It completely depends on the version you are using. If you are using the latest official one (3.9), stepping through the code is only possible by cloning the master branch and building the PDB files yourself.
In the latest prerelease versions via NuGet (the upcoming 4.0 version) you only have to enable the source server checkbox.
Note that you should never have to use GitHubLink yourself, that is for developers only (we run it during the build of Catel).
About the Fody task: it looks like the NuGet packages have not yet been restored on your side. In the lib folder there is a RestorePackages.bat which you can run to restore the packages.
I tried debugging on VS2012 and using Catel 4 pre-release (from Nuget)..
although I believe I did all the right things & settings in VS, I didnt get much further..
So I Opened (using a bin editor) the pdb file that was pulled by Nuget with the DLL, and took a look at the bin file.
the file have strings pointing to the source files at this directory :
C:\ci_ws\WS\1629\source\catel\src\catel/mvvm\catel.mvvm.shared..
So I have created a tree that starts with
c:\ci_ws\ws\1629\source
and downloaded the catel folder to that dir, renamed it from
"Catel-Develop" to just "Catel" in order to feet the location the pdb pointed.
To get things going I also had to add a "Symbol File(.pdb) location" in VS
option-> settings->Debugging->Symbols..(location/server list) to where the nuget download the packages.
in my case.. SolutionFolder\Packages\Catel.MVVM.3.9.0.1406062245-beta\lib\sl50..(I'm using Silverlight)
and then I was able to load the symbols and step/break into the code successfully ..
Maybe I missing something and there is a better way, but this the only way that worked for me..
The only question that still remains for me now is : What is the name of the Catel Github source branch that is matching the pre-release dll and pdb that Nuget is publishing at the moment (3.9.0.1406062245) ?
(I unchecked the general debug settings of : require source files to exactly match the original version)
Having upgraded to Visual Studio 2013, I have found that an old SQL project fails to load when I attempt to open a solution. The error displayed is:
The imported project "C:\Program Files (x86)\MSBuild\12.0\bin\SqlServer.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. C:\Some\Path\To\Project\Database.sqlproj
In my .sqlproj file I have the line
<Import Project="$(MSBuildToolsPath)\SqlServer.targets" />
which in Visual Studio 2012 resolves to C:\Windows\Microsoft.NET\Framework\v4.0.30319\SqlServer.targets but in Visual Studio 2013 this resolves to C:\Program Files (x86)\MSBuild\12.0\bin\SqlServer.targets. However, the SqlServer.targets file is in neither of these locations.
Presumably this is due to MSBuild becoming part of Visual Studio, rather than it being part of the .Net Framework.
Does anyone know how to fix this issue and to migrate this project to Visual Studio 2013?
Just copied SqlServer.targets from C:\Windows\Microsoft.NET\Framework\v3.5 to C:\Program Files (x86)\MSBuild\12.0\Bin and it helps. VS2013 is now able to open the old project.
I had a similar problem when upgrading from Visual Studio 2008 to 2013.
It took awhile but I had to install the SSDT for VS 2013 (again), then I created a new database project to find out the relative path to the new sqlserver.targets file.
It should be as follows:
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
The biggest hindrance that I found to fixing this error was trying to understand the error message provided (BC2014: the value 'database' is invalid for option 'target')
Hope this helps!
I had the same problem and I solved this way:
Just create a file named 'SQLServer.targets' on 'C:\Windows\Microsoft.NET\Framework\v4.0.30319' with the following content:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SqlClrTargetsFullPath>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlClr.targets</SqlClrTargetsFullPath>
</PropertyGroup>
<Import Project="$(SqlClrTargetsFullPath)" Condition="Exists('$(SqlClrTargetsFullPath)')"/>
</Project>
Good luck.
This can also occur when opening an older project in Windows 10
I had the same problem (SqlServer.targets was not found) when opening an old SQL Server CLR assembly in Visual Studio 2010 on Windows 10, the same version used originally to write the assembly.
Confirmed the same project opened perfectly fine in Visual Studio 2010 on a Windows 7 computer.
Solution
Pay attention to the error message. In my case it was:
The imported project “C:\Windows\Microsoft.NET\Framework\v4.0.30319\SqlServer.targets” was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
Simply copy SqlServer.targets from the location indicated in Vladimir Dronov's answer, "C:\Windows\Microsoft.NET\Framework\v3.5\SqlServer.targets", to the directory indicated in the error message.
In my case that was "C:\Windows\Microsoft.NET\Framework\v4.0.30319\".
I had the same problem when trying to build a VS 2010 solution under VS 2013. The fix was to upgrade the solution file to VS 2013 first. After that it worked without further modifications.
The Error Resulting from Several of these Solutions
I posted a specific question (C# VS 2013 Error 02019: Invalid target type for /target: must specify 'exe', 'winexe', 'library', 'module', 'appcontainerexe' or 'winmdobj' CSC) regarding the fatal build error described by Chris Torng below Vladimir Dronov's answer:
Error 1 02019: Invalid target type for /target: must specify 'exe', 'winexe', 'library', 'module', 'appcontainerexe' or 'winmdobj' CSC
The Fix
I was able to get rid of the error related to SQL Server dev tool compatibility issues in VS2013 Community Edition by following the advice in this forum:
https://connect.microsoft.com/SQLServer/feedbackdetail/view/979839
Posted by bsclifton on 11/15/2014 at 7:18 AM
Had this issue too with the Community 2013 edition; Going to Tools->Extensions and Updates and updating "Microsoft SQL Server Update for database tooling" resolved the issue :)
If this doesn't work for you, I'd recommend checking out that forum as it offers up several other ideas for how to fix the problem
Solution 1:
If the project is a .csproj file, you should check if Visual Studio also generated a .sqlproj file while upgrading. If that is the case, you can add that to the solution instead.
Solution 2:
You can try to change the following line in the .sqlproj file:
<Import Project="$(MSBuildToolsPath)\SqlServer.targets" />
to
<Import Project="$(MSBuildBinPath)\SqlServer.targets" />
I have built a Wpf UserControl Library and it contains a large group of assemblies and even references two other class libraries and several merged resourceDictionaries. It builds without error. I built a simple VSX package and referenced the Wpf Library, then tried to run it. As it parsed the page it was able to find only part of the assemblies referenced on my xaml UserControl page. It gives me the error message below in the fusion log for each unbindable assembly. If I remove the "bad" assembly it continues parsing to the next unfindable one. It is able to find one of my referenced classlibraries, but not the other. They are set up essentially the same with different class content.
So, does anyone have any resources or answers for this? My other test projects that even contain WCF services load with no issues and this is a stumper for me.
Thanks, Danny
=== Pre-bind state information ===
LOG: User = AMRS\dhoneycu
LOG: DisplayName = System.Windows.Interactivity, PublicKeyToken=31bf3856ad364e35
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.Windows.Interactivity, PublicKeyToken=31bf3856ad364e35 | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/System.Windows.Interactivity/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/System.Windows.Interactivity/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/System.Windows.Interactivity/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/System.Windows.Interactivity/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio
You should put a ProvideBindingPath attribute on your VSPackage class. This will cause the directory where your package assembly resides to be probed for assemblies that otherwise can't be found (because they don't reside in the default VS probing path). To do so, include the following file in your project:
%VSSDKInstallDir%\VisualStudioIntegration\Common\Source\CSharp\RegistrationAttributes\ProvideBindingPathAttribute.cs
Then, add the following attribute to your VSPackage class like the following:
[ProvideBindingPath]
public class VsPackage1 : Package
{
...
}
Thank you so much!
I spent the better part of a day trying to figure this out. It seems like if an assembly is in the VSIX package, it should certainly be found by Visual Studio, however looking at the Fusion Log, I was perplexed why it never actually seemed to scan anywhere except the standard system locations.
I want to note that the ProvideBindingPath attribute is included in the Microsoft.VisualStudio.Shell namespace in later versions of the VS SDK.