Unable to build module in typescript - visual-studio-2013

I am newbie in Typescript.
I have created a new project in Typescripts in Visual Studio 2013.
But whenever I try to build my project I am facing an error:
'Error 1 Cannot compile modules unless the '--module' flag is provided'.
Please suggest where I am doing wrong.

Well, I was using require js in my project and that needs AMD option to be enabled from project->properties->typescript build -> Module System = AMD.
After checking the Radio Button my problem got solved.

Related

VSTS Specified TypeScript compiler not found

I am using VSTS for a project that is using TypeScript. We have a CI Build configured and suddenly that one stopped working today. Yesterday all was fine, today they are all failing.
Looking into the build logs I discovered that it's not finding the TypeScript compiler that we specified:
Warning : Your project specifies TypeScriptToolsVersion 2.1, but a matching compiler was not found. The latest available TypeScript compiler will be used (2.4). To remove this warning, install the TypeScript 2.1 SDK or update the value of TypeScriptToolsVersion.
So all of a sudden it starts compiling with TypeScript 2.4 and we have some code that's not compatible with that version (Promises).
I have defined the TypeScript Tools Version in our .csproj as
<TypeScriptToolsVersion>2.1</TypeScriptToolsVersion>
and that seems to be working as I read in the build logs that it tried using that one first.
Any idea what caused VSTS suddenly to "forget" about TypeScript 2.1 and how I can fix this? I could not find any update notification or anything.
Right click on Project and click properties
Click on TypeScriptBuild and Select Use Latest Available
That means the TypeScript SDK has been updated on build server. If you are using private build agent, you can check it on your build server. If you are using Hosted agent, it will be updated irregularly (official article isn’t updated)
Regarding this issue, you can refer to these threads:
For VS 2015 project (Microsoft.TypeScript.MSBuild package): Visual Studio Team Services build Typescript error
For VS 2017 project (Microsoft.TypeScript.MSBuild package): Angular4.1 with .NET Core1.1 build fails in VSTS Hosted VS2017 agent

Visual Studio 2013 with Angular2 and Typescript

I'm using the angular2 QUICKSTART and I have a problem where Visual Studio don't recognize Angular2 with typescript import Modules, in rest all it's fine:
It says:
Cannot find module 'angular2/platform/browser'
My app :
is compiling .ts files without errors
it runs in browser without errors
if I open the project in VS code it works fine, no errors in IDE
I know that typescript should read .d.ts file directly from node_modules --> angular2, but anyway I tried to add angular2 DefinitelyTyped and still not worked.
Atm I use VS 2013 update 5 with typescript 1.5 installed (I also tried with 1.75)
Please right click on the visual studio project and click on the Properties option, Then select Typescript Build,default 'none' is selected, change it to 'CommonJs'.
If again any problem regarding 'experimentalDecorators' persists unload the project and add <TypeScriptExperimentalDecorators>true</TypeScriptExperimentalDecorators>statement inside the PropertyGroup tag.
Again problem exists on building the project such as 'could not find the name Map', 'could not find the name Promise', or 'could not find the name Set' try to change the target to 'es6' in the tsconfig.json
Solved by using Visual Studio 2015.

stop solution build on first compilation\link error - msbuild

I'm compiling a solution with many projects inside using VS2013's MSBuild. I want the build to stop if one of the projects fails to compile and that the error code of msbuild will be non-zero to indicate something has failed. Can it be done?
I am running this command to start compiling:
%MS_BUILD_PATH% "%workarea%\WindowsSolution.sln" /p:Configuration=Release /p:ContinueOnError=false /p:StopOnFirstFailure=true
but it doesn't work as I want it. Any suggestions?
If anyone is still looking for this feature in Visual Studio, there is a free extension called [VSColorOutput] (here), which has an option to stop the build on first build error. Once you have installed the extension, the options is located at: Tools.Options.VSColorOutput.Build Actions.Stop Build On First Error
The official documentation says StopOnFirstFailure: If true, when one of the projects fails to build, no more projects will be built. Currently this is not supported when building in parallel (with multiple processors).
Can you try setting BuildInParallel=false and see if that helps?
Edit: Found an old blog post that says this might be easy to do if you're building a single .sln with multiple projects http://blogs.msdn.com/b/manishagarwal/archive/2006/05/09/593392.aspx
I'm using StopOnFirstBuildError
https://marketplace.visualstudio.com/items?itemName=EinarEgilsson.StopOnFirstBuildError
It stops the build when the any project building fails. I'm using on 2015. The linked page says it works with Visual Studio 2012, 2013, 2015, 2017.

Error on loading Xamarin.Forms sample project

Just playing with Xamarin.Forms, downloaded sample project TipCalc from here. When I try to open the solution in Xamarin Studio I am getting this error.
When i try to build the project, i get this error
Error MSB4019: The imported project "C:\Program Files
(x86)\MSBuild\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets"
was not found. Confirm that the path in the declaration is
correct, and that the file exists on disk. (MSB4019) (TipCalc.Android)
Please someone guide me, what should i configure in my project, to make this to run successfully. I am using Xamarin Studio 5, my OS is windows 7 ultimate.
I installed Portable Library Tools followed by Xamarin.Android to fix this. This error occurs if we try to load the pcl project without installing portable library tools, because Xamarin checks for following file in the machine while loading pcl project.
C:\Program Files
(x86)\MSBuild\Microsoft\Portable\v4.0Microsoft.Portable.CSharp.targets

Native linking failed - Xamarin For Visual Studio

I am trying to build an iOS app on windows visual studio using Xamarin For Visual Studio Trial. When compiling I am getting this error:
Error 136 MT5201:Native linking failed. Please review user flags provided to gcc: "-L/Users/brandon/Library/Caches/Xamarin/mtbs/builds/iCropTrak_vsios/9bc8504a-65b2-484f-b71c-1d0cb02d21f6" "-lgdal_x86" "-lc3dsqlite3" "-lstdc++" "-all_load" [K:\Development\AZSim\Products\CropTrak\iCropTrak_vsios.csproj]
0 0
It compiles fine on the mac - but having trouble getting it going with the windows version. Any ideas as to why?
Do you use {ProjectDir} in your project options ? If so you might be running into a current limitation where the directories won't match between platforms.
You should be able to workaround it, either by replacing {ProjectDir} or much better by using the [LinkWith] attribute.
You can bundle the Native reference inside a dll.
Take a look on this: http://forums.xamarin.com/discussion/comment/5371/#Comment_5371
and this:
https://github.com/viniciusjarina/NativeBindingVS
Thank you.
we discover this issue like two weeks ago, this only happens in simulator AFAIK. Seems that the dependency LevelDB left their Main symbol. I'll file a bug on Firebase. The workaround for this is to change the behavior of the Registrar on Simulator:
Open your project settings
Go to Build tab
Select iOS Build option
Type --registrar:static in Additional mtouch arguments textbox
Click on Ok
Don't forget to add this in Release and Debug configuration of iPhoneSimulator platform.
when i checked the source of the packages i found that they relies on
Xamarin.Build.Download
when i install the package problem resolved .

Resources