Compiling SubSonic 3.0.0.4 from sources - subsonic

I downloaded SubSonic 3.0.0.4 sources from https://github.com/subsonic/SubSonic-3.0 and compiled it using Visual Studio 2010. When I add the compiled SubSonic.Core.dll to my own project and try to use the SimpleRepository like this
SimpleRepository repo = new SimpleRepository(ProviderFactory.GetProvider(connectionString, "System.Data.SqlClient"), SimpleRepositoryOptions.RunMigrations);
the dll crashes:
An unhandled exception of type 'System.TypeInitializationException' occurred in SubSonic.Core.dll
Additional information: The type initializer for 'SubSonic.DataProviders.DynamicProxyInterceptionStrategy' threw an exception.
Crash occurs at SubSonic's DbDataProvider.cs on line 56:
InterceptionStrategy = new DynamicProxyInterceptionStrategy(this);
All works fine if I download ready-made SubSonic.Core.dll from the project's web site and use it. But I wanted to compile it myself, because I'll try to do some modifications on it later.
Thanks
Bapu

I've had success with downloading the latest revision from Git and upgrading Subsonic in an existing project (which has a Microsoft SQL database). I first compiled the Subsonic.Core project, swapped my old dll with the new and had the same error as you.
The inner exception states that it's missing a reference to Castle.Core. Just add a reference to Caste.Core with is found in the /lib folder and you should be good to go.

Adding the Castle.Core.dll, solved the same issue for me.

Related

The type or namespace XXX could not be found(are you missing a using directive or an assembly reference?

I'm working on a project that targeting .NET 4.0 Framework. I added a reference to a third party dll file and call its methods in my code and have no error. But when I build the project it gave me The type or namespace error with blue underline on the methods of the dll. Using .NET Reflector I checked dll .NET Version of mscorlib.dll it is 4.0.0.0. My application Target .NET Version is 4.0 then Why I'm getting this error.
What I have done.
Remove all references to the library. Clean the project. Restart the project. again add the references. Not good in English please guide me. Stuck in it last 4 days.
Check if you have privileges to access the dll file. Then try running Visual Studio as administrator. If it does not help try to build the solution as 64x/86x not Any CPU.

Project is targeting frameworks not installed or are included as part of future updates to Visual Studio

I am attempting to convert the Microsoft.Health C# class library that is installed as part of the HealthVault SDK, using instructions provided here. After following these instructions, I get the following error when attempting to load the project into Visual Studio 2013.
"The project is targeting frameworks hat are either not installed or
are included as part of future updates to Visual Studio. See
http://go.microsoft.com/fwlink/?LinkId=287985"
Visiting the link takes me to .NET SDKs and Downloads. Once there, I have no clue on what needs to be done.
I do realize that one will have to leverage the Portable Class Library Contrib project to fill in some missing bits, especially code related to System.Security. This, I will deal with later.
Any one run into a similar problem?
Maybe so late but for those who have the same problem.
I had the same error in a project which was working perfect before updating VS2013 and finally after 3 hours looking for the source of the error I found that the error is about TargetFrameworkProfile.
In my case I sloved it like so:
Right click in the unloaded project in your solution and click Edit.
Find the TargetFrameworkProfile tag and set it as below:
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>
At a guess, this is because you need to specify the TargetFrameworkVersion and TargetFrameworkProfile properties in the project file. Compare the .csproj you are trying to create to a newly created PCL project file, and make sure that everything that's not specific to your project matches.
I ran into the same issue and got it resolved by installing the latest Visual Studio Update

The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly

After installing Slow Cheeath (v. 2.5.10.3) to two projects in my solution, I am receiving the following error:
"The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly C:\Users
\User\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\SlowCheetah.Xdt.dll. Could
not load file or assembly 'file:///C:\Users\User\AppData\Local\Microsoft\MSBuild
\SlowCheetah\v2.5.10.2\SlowCheetah.Xdt.dll' or one of its dependencies. The system cannot
find the file specified. Confirm that the <UsingTask> declaration is correct, that the
assembly and all its dependencies are available, and that the task contains a public
class that implements Microsoft.Build.Framework.ITask. ISA.IMPD.FalseAlarm.Web.Portal"
I have removed both projects in their entirety (along with Slow Cheetah), re-installed both projects (along with Slow Cheetah), and Rebuilt the solution to no avail. Can anyone help with this type of error?
In my case the error occured while compiling a web project. The folder
%userprofile%\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2
was empty. All the SlowCheetah components were in SlowCheetah\v1 folder instead. I've copied all files from V1 folder to v2.5.10.2 and everything compiled and transformed fine. To make non web projects compile, I also had to delete V1 folder as suggested by Whoever in this thread.
This was a brand new installation of the SlowCheetah Extension and I did not expect the v1 folder to exist at all. I believe this was a bug in the extension installation for Visual Studio 2012.
delete
AppData\Local\Microsoft\MSBuild\SlowCheetah\v1
I seem to have found to solution to this problem.
Here's what I did:
You need to close Visual Studio, then navigate to:
C:\Users\username\AppData\Local\Microsoft\VisualStudio\11.0\Extensions
Delete the cache file that has the latest date and time
Open Visual Studio and remove Slow Cheetah from the Solution level
Re-install Slow Cheetah from the solution level to the desired projects.
This was failing on our build server, so I changed the revision number from:
<sc-MSBuildLibPathLocal Condition=" '$(sc-MSBuildLibPathLocal)'=='' ">$(LocalAppData)\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\</sc-MSBuildLibPathLocal>
To:
<sc-MSBuildLibPathLocal Condition=" '$(sc-MSBuildLibPathLocal)'=='' ">$(LocalAppData)\Microsoft\MSBuild\SlowCheetah\v2.5.10.3\</sc-MSBuildLibPathLocal>
Why it was pointed to v2.5.10.2 is a mystery, but I'm definitely using v2.5.10.3! Looks like the nuget package itself has the bug in it.
I resolved it like this:
Uninstall slowcheetah => Tools>Extensions and Updates
click OK when VS asks you to restart VS.
in "C:\Users\AppData\Local\Microsoft\MSBuild\SlowCheetah" remove the 'v1' folder (which windows automatically creates when restarting your VS) (here be dragons..)
reïnstall slowcheetah (see step 1) => a new folder v2.5.10.2 will be created.
Again, click OK when he asks to restart
Build your solution
Regards,
Peter
This problem went away for me after using the preview transformation feature in the context menu. Originally suggested here.
FYI this was on VS 2010 Premium.
Having multiple versions can lead to conflicts.
In my case I have installed both Microsoft.VisualStudio.SlowCheetah by Microsoft and SlowCheetah by Sayed Ibrahim Hashimi. After uninstalling the package from Microsoft everything went well.
I have deleted the old files in C:\Users\\AppData\Local\Microsoft\MSBuild\SlowCheetah\v1. I also needed to upgrade Visual Studio 2012 to update 4 to make it work.
I was able to fix this issue by doing the following:
Uninstalling the SlowCheetah extension from the TOOLS > Extensions and Updates... menu
Closing Visual Studio
Deleting all files in the "C:\Users\username\AppData\Local\Microsoft\VisualStudio\11.0\Extensions" folder
Opening Visual Studio
Reinstalling SlowCheetah from the TOOLS > Extensions and Updates... menu (which requires a Visual Studio restart)
This is using Visual Studio 2012 Premium with Update 4 and SlowCheetah version 2.5.10.
If you're getting this error on a TFS Build Server (in my case TFS Express 2013) then you will need to copy over the files from your local machine
C:\Users\SWEAVER\AppData\local\Microsoft\MSBuild\SlowCheetah
on your machine to whichever user your TFS build is running under
C:\users\TFSBuild\AppData\Local\Microsoft\MSBuild\SlowCheetah
Please note AppData is a hidden directory that you may not see, but just type the name and hit enter and it will come up.
I'm using VS2013 so I didn't copy v1 (I think v1 is for VS2012).
The original TFS error I got was :
C:\Builds\1\www.XXXXX.com\RRStore - XXXXX
Silverlight\Sources\RRStore.AdminConsole\Properties\SlowCheetah\SlowCheetah.Transforms.targets
(150): The "SlowCheetah.Xdt.TransformXml" task could not be loaded
from the assembly
C:\Users\TFSBuild\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\SlowCheetah.Xdt.dll.
Could not load file or assembly
'file:///C:\Users\TFSBuild\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\SlowCheetah.Xdt.dll'
or one of its dependencies. The system cannot find the file specified.
Confirm that the declaration is correct, that the assembly
and all its dependencies are available, and that the task contains a
public class that implements Microsoft.Build.Framework.ITask.
Fortunately this error told me exactly where to place the files.
I had the same problem in Visual Studio 2013. Just install SlowCheetah NuGet package:
https://www.nuget.org/packages/SlowCheetah
They've released a new version which brings the installation procedure up to date:
https://blogs.msdn.microsoft.com/visualstudio/2017/05/25/whats-new-and-improved-with-the-slowcheetah-extension/
Tired of having to install your NuGet packages manually to get
SlowCheetah to work? We’ve added automatic NuGet installation to help
streamline your process. All you need to install is the latest
extension and SlowCheetah will take care of the rest. When you use
SlowCheetah for the first time in a project, it will prompt you to
install or update NuGet packages. Agree and you’re ready to go!
Close Visual Studio
Install the VISX extension
Open your project.
This version detects if you already have it installed and offers to upgrade.
I would recommend checking in to source control and then doing a compare of your .csproj file to see what changes it made.

Windows Work flow assemblies not picking up

We we trying to create a work flow dll using Windows Work Flow but we are running into major problems regarding referencing.
1.) We have a class that calls an activity but the class cannot pick up the activity that has already been created
WorkflowAcivity workflowActivity = new WorkflowActivity(string id)
This then throws an error message saying cannot find WorkflowActivity
2.) We then added extra assemblies, like one of our other dll's, Visual Studio also cant find these references when we call a class in those dll's we are referencing.
3.) Intellisence has also stopped working??
What do we do to fix this, is it the version we are using or are there any other assemblies we are missing here??
We have tried opeing the solution on another pc, uninstalled vs 2012 and installed vs 2013 and still have no luck!
Got caused by System.Net.Http.Primitives.dll referencing some dll's that were missing and caused the workflow to break without any warnings.
Removing this dll or adding the referenced dlls back in (System.Runtime.dll and System.Runtime.InteropServices.dll) fixed the problem.
Microsoft ticket for this.

Entity Framework 6 with Sharepoint 2013

I tried without success to get a SharePoint 2013 application page or web part to work with Entity Framework 6 (6.0.1 to be exact - the version installed into Visual Studio 2012 by default using NuGet at time of writing).
My code was very simple for test purposes, just reading data from one table.
I could install the package just fine, create models, see that the they were properly configured etc, no problem - but whenever I tried to load the page I got the error:
Event code: 3008
Exception type: ConfigurationErrorsException
Exception message: An error occurred creating the configuration section handler for entityFramework: Could not load file or assembly 'EntityFramework' or one of its dependencies. The system cannot find the file specified. (C:\inetpub\wwwroot\wss\VirtualDirectories\[sitename]\web.config line 36)
I copied all of the config settings from the App.Config file in VS (created by the EF install), into the web.config, verbatim.
I tried every suggested fix I could find on the interweb (e.g. changing the EF assembly ref to "Specific version = false", changing version refs in the config file to the specific version... all sorts) but nothing worked.
I created a console app using the same settings and it worked fine, so I know it's not a server-specific issue - looks like a compatibility issue with SP2013, anyone have any ideas?
I installed EF 5 using the NuGet console, and finally got it working with that... but I'm very curious as to why EF 6 refused to play ball.
Thanks
Poolio
You need to deploy the Entity Framework assemblies (EntityFramework.dll, EntityFramework.SqlServer.dll) as part of your SharePoint solution package. You can reference external dlls in the package.

Resources