Subsonic 3.0 setup problems - subsonic3

I am trying to re-create the setup project as shown in the video of http://subsonicproject.com/docs/Setting_up_SubSonic_3.0
i am using visual c# 2008 express edition and following all the steps but something is wrong.
the settings.ttinclude is as follows:
const string Namespace = "WSC";
const string ConnectionStringName = "WSC";
//This is the name of your database and is used in naming
//the repository. By default we set it to the connection string name
const string DatabaseName = "WSC";
//this is a list of tables you don't want generated
string[] ExcludeTables = new string[]{
"sysdiagrams",
"BuildVersion",
};
.. i am adding the subsonic.core.dll referense and creating the app.config with the following settings:
I am also copying the ActveDirectory Folder found in the t4 templates directory to the solution. .cs files are supposed to be generated here but they are not.
Can anyone help pls.
Regards,
Adrian

It's not that SubSonic doesn't work with Express per se...it's that Express doesn't support T4 templates, which are used by SubSonic to generate your classes.

apparently subsonic 3.0 does not work with the express version of visual studio 2008. I tried it with a standard version of VS 2008 and everything worked perfectly.
Can anyone confirm my claim please.
Keep up the good work
Adrian

Related

How to show only method name in Test Explorer in VS 2017 (using xUnit for .NET Core)

I know there is this question:
How can XUnit be configured to show just the method name in the Visual Studio 2015 Test Explorer?
I tried both the solution using XML and the JSON file but the name in Text Explorer Window is still the full name with the class. I want to display the method name only as its hard to read the fully qualified names.
Its stated on this site that you can configure using XML
Configuring xUnit.net with XML
but I can't make the effect I'm expecting happen. I've restarted VS 2017 after adding an app.config file in the test project, but still nothing. Is it different for VS 2017?
I had the same issue. I'm doing a project in VS2017 using .NET Standard and solved it by following these steps:
In your tests project, create a file named xunit.runner.json
Add the following to the file: { "methodDisplay" : "method" }
In the Solution Explorer, right-click on xunit.runner.json and select "Properties". Set Copy to Output Directory to "Copy Always".
Taken from this comment.
W. Hampson answer is perfect, but just to inform about other possibility - use DisplayName attribute.
[Fact(DisplayName = "Just simple check")]
public void Check()
{
Assert.NotNull(_operation);
}

Cannot find VCCLCompilerTool in VS2015 macro (using Visual Commander)

I am using Visual Commander (from https://vlasovstudio.com/visual-commander/) to port some macros for manipulating C++ projects from VS2010 to VS2015. Things seem to work OK (I can access solutions, create VCProjects, loop through Configurations, etc.), but I am having one problem - the call which worked in VS2010:
cfg.Tools("VCCLCompilerTool")
...fails in VS2015, with a "System.MissingMemberException: No default member found for type 'VCCollectionShim'." error, suggesting that the collection doesn’t have a "VCCLCompilerTool" item.
Does anyone know how to fix this? Or another way to get access to the C++ compiler settings for a configuration? (Other than manually parsing the vcxproj XML file.)
If I print out the ToString() value of each item in cfg.Tools, I just see 'shims' such as 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCCLCompilerToolShim'.
If I do the same in a real VS2010 macro (which works), every item shows as 'System.__ComObject'.
Searching on the internet suggests that a ‘shim’ error means that the code is accessing the wrong version of the VCProjectEngine or VCProject assemblies. I do have VS2005 and VS2010 installed for use in other projects, but I’ve temporarily renamed every place where old versions of these DLLs live and still get the same problem. Maybe it’s still getting it from somewhere else, like the GAC?
I tried inserting the sample from the IVCCollection.Item Method documentation at https://msdn.microsoft.com/en-US/library/microsoft.visualstudio.vcprojectengine.ivccollection.item(v=vs.140).aspx into a Visual Commander command, and got the same result.
Imports EnvDTE
Imports EnvDTE80
Imports Microsoft.VisualBasic
Imports System
Imports System.Diagnostics
Imports Microsoft.VisualStudio.VCProjectEngine
Imports System.Text
Public Class C
Implements VisualCommanderExt.ICommand
Sub Run(DTE As EnvDTE80.DTE2, package As Microsoft.VisualStudio.Shell.Package) Implements VisualCommanderExt.ICommand.Run
EnablePREfastExample(DTE)
End Sub
Sub EnablePREfastExample(ByVal dte As DTE2)
Dim prj As VCProject
Dim cfgs, tools As IVCCollection
Dim cfg As VCConfiguration
Dim tool As VCCLCompilerTool
Dim sb As New StringBuilder
prj = CType(dte.Solution.Projects.Item(1).Object, _
Microsoft.VisualStudio.VCProjectEngine.VCProject)
cfgs = CType(prj.Configurations, _
Microsoft.VisualStudio.VCProjectEngine.IVCCollection)
cfg = CType(cfgs.Item(1), _
Microsoft.VisualStudio.VCProjectEngine.VCConfiguration)
' This fails
tool = CType(cfg.Tools("VCCLCompilerTool"), _
Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool)
sb.Length = 0
sb.Append("Current project PREfast setting: " _
& tool.EnablePREfast & Environment.NewLine)
sb.Append("Flag: " & tool.AdditionalOptions)
MsgBox(sb.ToString)
End Sub
End Class
I set the value in the References… dialog in Visual Commander to "Microsoft.VisualStudio.VCProjectEngine". (I also tried fully specifying the path name like "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.VCProjectEngine.dll", or a full GAC name like “Microsoft.VisualStudio.VCProjectEngine, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” and got the same bad result.)
Thanks to Sergey Vlasov, author of Visual Commander, I found the answer. He pointed out that the C# version of the sample code worked in VS2015. The C# and VB code are slightly different in the line in question. The C# code is:
tool =
(Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool)
tools.Item("VCCLCompilerTool");
while the VB code is:
tool = CType(cfg.Tools("VCCLCompilerTool"), _
Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool)
This VB works fine in VS2010, but it looks like in VS2015, the Tools collection can no longer be indexed by name by default. So I just needed to add ".Item", which changed the VB code to this:
tool = CType(cfg.Tools.Item("VCCLCompilerTool"), _
Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool)
Now everything's fine with this macro.

Roslyn workspace.OpenSolutionAsync().Projects always empty?

I'm trying to create a self-hosted WebAPI 2.0 project that allows you to open/explore/build .sln solutions through an API.
Here's the code within one of my controllers, that's supposed to return a list of projects given a path to the .sln:
public async Task<IHttpActionResult> GetProjects(string slnPath = "")
{
var workspace = MSBuildWorkspace.Create();
var solution = await workspace.OpenSolutionAsync(slnPath);
var projects = solution.Projects;
}
I would expect projects to hold the projects in the solution, but according to the debugger, solution.Projects and solution.ProjectIds always seem to be empty.
I've tried this with multiple .sln files, all of which I can open in Visual Studio and see that they have projects in them.
I've seen this question, but my project isn't a Visual Studio add in, it's a class library called from a command line application.
This is generally caused by one of a few things, in order of commonality:
You are missing copies of Microsoft.CodeAnalysis.CSharp.Workspaces.dll or Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll. Make sure when you are running your project that those DLLs are next to the main Microsoft.CodeAnalysis.Workspaces.dll.
You're loading solutions with project types we don't support. We should support any project type except the project-less Web Site projects. Class libraries should work just fine.
We have a bug that's causing us to mis-handle your particular project types. If that's the case, file a bug on GitHub.
If you are getting this issue in unit tests but not in your production code, ensure that you have referenced both Microsoft.CodeAnalysis.CSharp.dll and Microsoft.CodeAnalysis.CSharp.Workspaces in your test project.
JYL mentioned it in the comments of the selected answer but I didnt see it right away.

Incremental build in TFS - How do I update AssemblyInfo.cs version only for projects that have changed?

We have a solution in TFS 2012 that contains several projects. I have set up a Continuous Integration build on our build server and have set Clean Workspace = None. I'm using the TFS Versioning template 2.0 to update the AssemblyFileVersion and AssemblyVersions.
When the build is run, each project has its AssemblyInfo.cs file updated with a new version number even though there have been no changes made to the code in some of the projects. Ideally we want the version to change only if there have been changes to the project.
I was considering building each project separately, but we would prefer to be able to simply build the solution. I have read that Clean Workspace = None should prevent the projects from being updated but it doesn't appear to be happening for me since the timestamp on all the dll's are showing as changed after the build.
I am new to setting up a build process, so I'm hoping there is something simple that I'm doing wrong. Any suggestions would be greatly appreciated.
Update:
After checking the suggested link, it appears that I'm doing two things during build that may be causing the issue: 1) web.config file transforms that take place in an "AfterBuild" step in one of my projects and 2) using the version number increment features in the "TFS Versioning" template without opening up the workflow to see how it is checking for changed files. I'll remove both of these and see what happens.
This is a good question and it is possible. I run powershell scripts that use the TFS API to determine what files have changed
You need to get the changesets and shelvesets also, but once you have these you can get the information you want like this:
function Get-ChangesetChanges()
{
[CmdletBinding()]
param ([Parameter(Mandatory=$true)][string]$Changeset,[Parameter(Mandatory=$true)][string]$TFSServer)
[void][Reflection.Assembly]::LoadWithPartialName('Microsoft.TeamFoundation.VersionControl.Client')
[void][Reflection.Assembly]::LoadWithPartialName('Microsoft.TeamFoundation.Client')
$tfs = [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($TFSServer)
$vcs = $tfs.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])
$vcsChanges = $vcs.GetChangeset($changeset).Changes;
$changes = #();
foreach ($change in $vcsChanges)
{
$changes += $change.Item.ServerItem;
}
$changes;
}

OpenRasta + OpenWrap?

I'm new to both OpenWrap and OpenRasta. Not really that interested in Openwrap other than that seems to be the way to get OpenRasta. Anyways i've installed openwrap and followed the following tutorial to the T:
OpenWrap Tutorial
except of course i added OpenRasta-Core to my project:
O add-wrap openrasta-core
Everything completes without errors but OpenRasta is not added to my project:
Error 3 The type or namespace name 'OpenRasta' could not be found (are you missing a using directive or an assembly reference?) C:\Testing\OpenRasta\src\TestOpenRasta\Program.cs 7 7 TestOpenRasta
I'm not that familiar with the way that openwrap works and i'm not sure if its supposed to add a reference to your project or does some msbuild magic to dynamically added the references.
My Project is built using the .Net Framework 4.0 and it looks like the wrap directory only contains.Net Framework 3.5 version. Do i need to download the source and build manually?
You need to call init-wrap which is not in the instructions, as far as I remember.