VS2015 missing Auto-sync wwwroot/lib/ _references.js entries - resharper

So I am trying to connect up my Jasmine unit tests in a VS2015 web project with the resharper test runner and thought I would use the Auto-generate _references.js file to save me having to type the references in each test spec. The Auto-synced _references.js file doesn't however include any javascript dependencies from the wwwroot/lib folder. Bower is definitely copying them to that folder correctly, but the synchronization is ignoring that directory. I thought the references generation might scan the web project looking for .js files to reference but it seems to have missed a swathe of them.
According to Mads Kristensen:
Whenever a .js file is added, renamed, moved or deleted, the _references.js file is automatically updated to reflect the changes.
This doesn't seem to be happening with .js files in wwwroot/lib. Is this on purpose? Do I have to turn auto-sync off and do it manually?

Related

How to specify output directory for nuget binaries?

I have a nuget package which has .dlls files that it automatically copies to a directory when the program is compiled. Is there a way to specify where the dlls files will be copied to?
I know it's possible to modify the .targets file of the package but assume I don't have access to the package. The project is managed through git so I'd rather not have to distribute binaries along with the licenses included in the package. Currently when someone downloads/compiles the source, the nuget package is automatically downloaded through nuget restore. Is there a way to override the .targets file of the package?
I'd prefer not to use scripts to manage the dll files if possible. Also this is for a C++ project and I know nuget has restrictions based on the languages used.
If your question is asking if there's a simple configuration file or something similar where you can write "copy contents of package X to location Y", then no.
To most people, the difference between the various components in the build system are not important, so it doesn't matter to them if NuGet copies something or their project's SDK copies something, or MSBuild copies something. However, since you're now trying to do something more advanced, these differences may be important. NuGet only writes/copies files at restore (and therefore only to the packages folder, not the project output folder), but after restore, NuGet doesn't run at all. NuGet just makes the files known to the rest of the build system, and those components are responsible for deciding what to do. For example, where to copy files.
Since both C++ and .NET projects use MSBuild, the same debugging techniques can be used. From a "developer command prompt", build your project using the -bl switch to generate a "msbuild.binlog" file. You can open this file with the MSBuild structured log viewer. You can then use the search to find where in the build each dll is copied, and what the copy arguments (including destination) is. You can also look to find where the item that defined the file to be copied was created. Then, you can write an MSBuild target in your project file (or another file that gets imported by your project file) that runs at an appropriate time and updates the item to set the destination you want the file to be copied to. But, MSBuild is a scripting language, and you said you didn't want to write a script, so you might not like this approach. And if you're not already knowledgeable about MSBuild scripting, it's probably more effort than writing a powershell script. But at least it would happen automatically as part of the build (and therefore happen when you build and debug in Visual Studio), and not be some other process that needs to be manually run.

How are the xsd.cs files used?

In a biztalk project, why do some XSD files have a hidden xsd.cs and some do not? What are these files used for and why is it, modifying the XSD and rebuilding does nothing to modify the .cs files?
For example: I have an XSD which is used to map messages to a SQL Send/Receive Port and execute a stored procedure. If I change the stored procedure (say change, delete, add a parameter) and thus, change the xsd to match, these changes aren't reflected when I deploy the orchestration unless I delete the xsd.cs. I CAN see the modified xsd in the Schemas tab of the BizTalk Administrative Console. I can see it is modified, yet I will still receive a message routing / mapping error unless that .cs is deleted and the orchestration redeployed. And by the way, after deleting, it never seems to regenerate though it also does not cause any issues.
Every xsd in your solution should have a .cs file. If you aren't getting them then there is something wrong with your solution. They are the compiled version of the schema that get deployed to the GAC. If the .cs file is not being changed after you recompile then you again have an issue. Check to see if you've accidentally checked the .cs files into source control and that they are now read-only (they should not be checked in).
When you modify the schema you need to both update the version of the schema in the BizTalk database and in the GAC. If you don't you will get some strange results. Using the Deploy option from Visual Studio will do this for you automatically, but if you are manually deploying you will have to ensure that it is both imported and GACed.
.cs files are generated for every BizTalk Artifact, that's how them become a .Net Type.
All of this should be handled automatically by Visual Studio. If you are having problems that only deleting .cs files will solve, then there's something wrong with your VS setup.
Note, the .cs files should not be in source control. If they are, remove them.
However, the scenario you describe doesn't make sense. What you see in BT admin is from the .cs file.

Publish Web App files to different locations

I'm start to develop modules for DotNetNuke. I followed different tutorials(most by Chris Hammond) but there is something i don't like, and I'm searching a different way to do so.
He recommends to put a DotNetNuke installation, with IIS and SQL Server, on the developer PC and put your Project into the DesktopModules folder. I don't like it because i want to separate my project from DotNetNuke.
Is there a way to split the build/publish to different location like dll into folder x and all other stuff into folder y?
You could, but I don't really see the point. I see where you're coming from because it seemed awkward to me at first as well, but it really is the most efficient way to develop on the DNN platform. I have mine set up so all of my modules are in the same solution and branched in source from the root DNN folder. We don't keep the DNN core in source so the developer is responsible for that, although that may change at some point to keep versioning consistent.
By keeping your project located where it's installed, you can develop your modules the same way you'd develop any other web app you're building. If you make a change in markup you just have to save the file and refresh your page. If you change something in code just build and refresh.
If you really must keep them separate, you can absolutely do so (really the only benefit of this that I can see is that if you uninstall a module and accidentally click the checkbox to delete files - it happens - you don't have to worry about it). Create your project where you want it, change the Output Path to your DNN bin folder, and create post-build events to copy all of your .js, .ascx, and .css files (plus any others you may need - images, HTML files, XML files, etc.) to appropriate folder(s) in the DesktopModules folder. Just remember that you have to build the project every time you make ANY changes to test them, and you have to write/change your post-build events every time you add a new type of resource, change/add a directory, etc.
Either that or you can build an install package and uninstall/reinstall the module every time you change some padding in your stylesheet ... but I'd stick with keeping the project in the DesktopModules folder.
Sure you can do that.
Set up your solution and module projects anywhere, build the projects and copy the appropriate parts (such as the *.ascx , *.ascx.resx, *.dnn files) back to your website folder -
website/ DesktopModules/Your_module_name
Copy the module dll to the website's bin and you good to go.

Defining shared library in Typescript and Visual Studio Express

I have ProjectA set up compiling and running in Visual Studio with Typescript. I now want to set up ProjectB, and use some of the code from ProjectA
So if my directory structure is:
c:\workspace\ProjectA\src
c:\workspace\ProjectB\src
c:\workspace\shared\src
is it possible to edit ProjectA and ProjectB .csproj files to point to the shared typescript code?
Thanks
I have tested this by placing the shared files (the TypeScript file and associated files) in a shared folder and then using Add > Existing Item and selecting Add As Link when I add the files.
If you are using reference comments, you'll need to use the relative path - if you drag the shared file onto a local TypeScript file it will generate this for you:
/// <reference path="../../Shared/Logger.ts" />
You will need to consider your deployment strategy. One way to do it would be to set the JavaScript files to copy on build, so they would all appear in your bin folder.
You might also want to consider packaging your shared stuff - you could make NuGet packages for them for example.
There is a workaround by editing the csproj file. You need to put in a entry for each subfolder, but for my case where I have lots of shared files, this is worthwhile. Using this method, all the files in a subfolder are also listed in the Solution Explorer.
<Content Include="..\..\shared\*">
<Link>src\shared\f</Link>
</Content>
<Content Include="..\..\shared\subfolderA\*">
<Link>src\shared\subfolderA\f</Link>
</Content>
<Content Include="..\..\shared\subfolderB\*">
<Link>src\shared\subfolderB\f</Link>
</Content>
The Link element shows the path as it will appear in the Solution Explorer. Note the extra \f at the end of the Link path. This can be any string and, for whatever reason, makes the parser interpret it in the way we want.
I've marked Steve Fenton's answer as correct since it is probably the best approach for most cases.
I was recently dealing with this problem. Here's how I got things running for me without dependencies on the other project.
I made my application with the source .ts files to run on my local IIS machine.
I then added reference to the js files in my testrunner file to point to the localhost address.
To write the tests and have access to the .ts files I just make added a copy as link file to my Typescript folder in my test runner project.
this worked pretty well for me. Thought I'd share.
By using Fenton's solution I was able not just to reuse source from project A, but also to debug it from project B. Solution behaves almost like project A is a class library.
Project A is a web app written in TS (empty web project template). Project B is UWP wrapper around Project A with some additional functionality. Here is the solution structure:
Solution
- Project A (ASP.Net Web Application)
- Scripts
- TS
- (all ts files)
- tsconfig.json
- App
- ts.js, ts.js.map, ts.d.ts (these three are result of compilation)
- Project B (UWP JS)
- Scripts
- App
- ts.js, ts.js.map, ts.d.ts (these three are added as links from A)
- TS
- (additional functionality)
Now, you can use breakpoints in Project A ts files while debugging Project B.

Why Does CruiseControl.NET need to be restarted after GetCcNetConfigFiles?

CruiseControl.NET service needs to be restarted to pick up changes in the projects configuration files.
I find this very annoying, not sure if it's a bug or it's the way it works.
Is there any way to overcome this issue in people's experience?
If your projects are separated in a different file from ccnet.config, then you need to restart the service unless you touch the actual ccnet.config.
We use ENTITY with SYSTEM file reference in ccnet.config for our projects, so we're in the same boat. I'm happy to pay the price for easier project maintenance, as it's easy to script a restart:
net stop CCService
net start CCService
IISRESET
If you wanted to completely automate this, and had your projects under source control, then you could trigger an update and restart whenever your project files are touched.
There was a bug in CC.Net prior to 1.4.4 if you were using a pre-processor include it did not reload the configuration when an included ccnet.config file was modified.
That was a bug that I reported and it is fixed in CC.Net 1.4.4 and greater.
Also, keep in mind that if a build is running and there is a change to the configuration it will not take place until that build is in an idle state.
How are you updating your config files? By hand? Mine always recognizes and adjusts. Is your config file in source control and designed to pull it down and replace the file? This for me requires a kick. How I ended up fixing it was have my project pull it down to a seperate folder. THen I call ccnet.exe -validate on it to make sure it is well formed, then I copy it over ontop of the current config file. CC.NET recognizes the changes and loads in the new config
Exceptions: If cc.net is currently running a project, it will not recognize the changes till that project has completed.
If your ccnet.config has errors, it will not ever recognize the changes and keep running the old version it has stored in memory. (However when CC.NET does restart it will try to parse the error filled config and choke.
Hope this helps!!
Do you mean you are using linked files, that is the ccnet.config file has links to the independent project files.
If so then they are not picked up, it's mentioned in the documentation that it doesn't watch the sub-files.
Internally we have modified our CruiseControl.net so that our ccnet.config is optionally a directory - and we can drop shortcuts to our project config files into that directory. We put watches on the directory, the files or shortcuts in the directory and all of the targets of the shortcuts. That means we have our project config files in ClearCase and just drop a shortcut into the ccnet.config directory.
I've just spent half a day or so moving from 1.2 to 1.4.2 dropping our changes into the new version for our internal use. We don't own our code, our client does and so it has to stay internal :(
I have never experienced this. Whenever I change the configuration files, the CruiseControl.NET service seems to automatically re-read them.
I'm using Version 1.3 of CC.NET.
Update:
In the service's config file (ccservice.exe.config), there is a setting to enable/disable watching the ccnet.config file for changes:
<add key="WatchConfigFile" value="true"/>
Make sure this is set to true.

Resources