SSIS package with Script task does not work when deployed programmatically - c#

I am running into the weird issue that the script component of an SSIS package deployed as part of an ISPAC file fails if the project deployment is done in an automated fashion - from C# or using PowerShell, that is. Deploying the exact same project using the Integration Services Deployment Wizzard in Visual Studio does not raise any erros when executing the package on the server.
However, I am getting various errors about things missing in the system namespace when executing the package that has been deployed with C# (using Microsoft.SqlServer.Management.IntegrationServices) such as:
DFT Load STG_ETL_TEST_STAGING_CDC:Error: CS0234 - The type or
namespace name 'ComponentModel' does not exist in the namespace
'System' (are you missing an assembly reference?),
Properties\Resources.Designer.cs, 59, 25
DFT Load STG_ETL_TEST_STAGING_CDC:Error: CS0234 - The type or
namespace name 'CodeDom' does not exist in the namespace 'System' (are
you missing an assembly reference?), Properties\Resources.Designer.cs,
25, 21
I exported the deployed packages and compared their file sizes. I noticed that the ISPAC of the manually deployed project is slightly bigger than the one deployed programmatically. What is the Deployment Wizzard doing to the project that isn't happening during automated deployment?
To exclude that it has something to do with my C# code, I also tried the following PowerShell script from the Microsoft docs. However, it does use the same assembly as I use in my code (Microsoft.SqlServer.Management.IntegrationServices) and the deployed package has the same issues.

I should have mentioned that the project was generated with Biml. Turned out the issue was not related to the binaries but the ISPAC file created by the Biml compiler. Building the project again with VS (using devenv.com theproject.dtproj -build) solved the issue for me and allowed for programmatic deployment of the project.

Related

TeamCity C# build failed most likely because of nuget restore issue

I am trying to set up a new TeamCity build job and am facing a build issue.
The build failed because of missing references within ResolveProjectReferences step.
For instance :
JSonTools\JSonHelper.cs(21, 7): error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)
Prior to the build step, 2 restore nuget steps are set up and both ran successfully (one for sdk like project and the second for previous version, in this order)
When I run my solution on the agent and restore nuget packages through VS it is working fine (and TC job will run successfully if made on the same agent)
I noticed the dlls pulled during the restore nuget steps are in the path of my sln, while it seems to be require on others path.
Several VCS are set for this job and from what i can see/understand, the failing projects seem to require the dll to be in their own path under the packages folder.
\this
\is
\my
\path
Project1.csproj
packages\ (<- contains all the Dlls)
\folder1
\Project2.csproj
\Project3.csproj
\packages\ (I have the feeling some Dlls should be here but the folder doesn't exist)
\folder2
\Project4.csproj
\packages\ (same as previously)
Did I missed something ?
Any help would be appreciated.
Thanks,
Cervelle

Blazor project builds locally but not in azure pipeline

I have a blazor server project using .net 5. I am able to run it fine locally and connect to my API. In my local project I have a swaggerClient and swagger.json file. In startup I call
swaggerClient swagclient = new swaggerClient(Constants.baseAddress, httpClient2);
Everything works fine locally, even if I deploy to IIS again works fine. I am now setting up pipeline in azure for CI/CD and have a dotnet core template to build my project. Anyways when it comes time to build in azure I have about 100+ plus errors that are all referencing classes that exist in my swaggerClient and Cannot find the file. For example:
/home/vsts/work/9/s/obj/Release/netcoreapp3.1/RazorDeclaration/Pages/Index.razor.g.cs(2952,75): error CS0246: The type or namespace name 'swaggerClient' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/9/s/FDI.csproj]
Anyways i'm not sure if i'm setting up the pipeline correctly or if there is any additional configuration I need to do to get this to work, i've been looking all over thanks.
Also I was referencing how Tim Corey connects to an API in this video: https://www.youtube.com/watch?v=nY-w9wPFEuY&ab_channel=IAmTimCorey
Looks like dev ops didn't have the reference to the swagger file in my project file and wasn't properly detecting changes, so it was never checked in properly.

IntelliSense complains about missing Microsoft.AspNetCore packages despite being there

In my Blazor application, on the client side, IntelliSense complains about a lot of Microsoft.AspNetCore packages although the project compiles and runs fine.
I get a lot of things like
The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
The type or namespace name 'Razor' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
...
Things like
#inject HttpClient Http
are also underlined with red squigglies.
The project builds and runs perfectly.
What is wrong here?
Followup 1
Because I was asked for all versions:
Visual Studio 2019, 16.0.2
Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview4-19216-03
In my project:
Id Versions ProjectName
-- -------- -----------
Microsoft.AspNetCore.Blazor.Build {3.0.0-preview4-19216-03} MyBlazorApp.Client
Microsoft.AspNetCore.Blazor {3.0.0-preview4-19216-03} MyBlazorApp.Client
NETStandard.Library {2.0.3} MyBlazorApp.Client
You need Visual Studio Preview version 16.1 or higher to work with 3.0.0-preview4 Blazor.
If that alone doesn't help, verify that you dont have any .cshtml files in your client project - they all have a .razor extension since 3.0.0-preview4. The presence of .cshtml file triggers a different SDK's behavior, requiring AspNetCore.Mvc namespace. Though Microsoft guys see it as a bug and probably will fix it.
https://github.com/aspnet/AspNetCore/issues/9640
Shut down VS
Delete the .vs folder or the .suo file
Restart VS
uninstalling x86 version of .NET Core 3.0 Preview SDK
https://dotnet.microsoft.com/download/dotnet-core/3.0
Then installing the x64 again on Windows10 64bit fixed that issue for me

I am trying to use SPMETAL generated model classes with Sharepoint 2016, getting errors on Microsoft.Sharepoint.Linq

After running SPMETAL.exe against my Sharepoint 2016 site, I imported the generated model to my project. I get 263 errors of the type "The type or namespace name 'Linq' does not exist in the namespace 'Microsoft.Sharepoint' (are you missing an assembly reference?).
By the way, in order to generate a datacontext model from your Sharepoint site for use with Linq to SQL with SPMETAL.exe, here's the command:
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\BIN\SPMETAL.exe" /web: /namespace: /code:
Change the "16" above, depending on the version of Sharepoint you have / which folder you have there.
I have already referenced Microsoft.SharePoint.dll and installed the client and client runtime using Nuget.
Did something major change and can I still use SPMETAL? I've done a ton of searches, but other namespaces with Linq show up and I still haven't found what assembly or package Microsoft.Sharepoint.Linq resides in.
After Googling quite a bit, I found a reference to the assembly the Microsoft.Sharepoint.Linq namespace is located within:
"Microsoft.Sharepoint.Linq.dll". I did a file search for that and found it in the .NET install, assemblies subfolder:
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Linq\v4.0_16.0.0.0__71e9bce111e9429c\
I included a reference to that in my project and all the errors went away.

Visual Studio Online CI Nunit references not resolved during build

I have been trying to get my solution to build in a CI configuration using Visual Studio Online and the hosted build controller.
I have created a folder in the root of my workspace with the required NUnit binaries as per these guidelines.
I have also referred to these previous questions where users had issues trying to accomplish the same thing:
Visual Studio Online CI Nunit Tests not found during build
What else is needed to get the Hosted Build Controller to run my NUnit tests
I have the "NUnit Test adapter for VS2012 and VS2013" package installed in all of my test projects.
The error messages in my build log are like this:
Tracking_works_when.cs (35): The type or namespace name 'TestAttribute' could not be found (are you missing a using directive or an assembly reference?)
The type 'TestAttribute' is one of several missing ones, including 'Test', 'TestFixture' and 'TestFixtureAttribute'.
There is also the following warning:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1605): Could not resolve this reference. Could not locate the assembly "nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
The same warning is repeated for "nunit.core.interfaces" and "nunit.core".
Question:
What am I missing? Why are my NUnit binaries not being identified within the hosted build environment and my tests run automatically?

Categories